Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write java code to print second max number in the array

Answers were Sorted based on User's Feedback



write java code to print second max number in the array..

Answer / rajesh s

If we give negative values, what would be the Rajaraman
code begaves????

Is This Answer Correct ?    0 Yes 1 No

write java code to print second max number in the array..

Answer / murali

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class SecondMax {
public static void main(String[] args) {
String [] str={"3","4","2","1"};
List<String> ls=Arrays.asList(str);
Collections.sort(ls);
System.out.println(ls.size()-1);

}

}

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

What does string intern() method do?

0 Answers  


What is a java string?

0 Answers  


Does java runtime require a license?

0 Answers  


What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?

0 Answers  


What is independent and dependent variables in research?

0 Answers  


What is the main functionality of Prepared Statement?

4 Answers  


What is java ceil?

0 Answers  


What is the difference between Java and C++?

0 Answers   Integreon, TCS, ZS Associates,


what is bytecode ?explain in detail and watz the difference between bytecode and machine code?

6 Answers   Lucent,


Why main() method is public, static and void in java ?

0 Answers  


Give reasons supporting that string is immutable.

0 Answers  


How does linkedlist work in java?

0 Answers  


Categories