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

whats the diff between jsp and servlets?

9 Answers   HCL, TCS,


When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?

0 Answers  


Write a program in java to find the maximum and minimum value node from a circular linked list.

0 Answers  


What does int argc char * argv [] mean?

0 Answers  


can we write a program with out a class in core java?

11 Answers   Wipro,


Is java owned by oracle?

0 Answers  


What is nextline method in java?

0 Answers  


What is the difference between Array and Hash Table?

0 Answers   Impetus,


Difference between String and StringBuffer.

3 Answers   GE, IBM,


write a progam hashmap & hashtable?

2 Answers   IBM,


What is a null check?

0 Answers  


What is the difference between class & object?

0 Answers  


Categories