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 is aggregation?

1 Answers   Cap Gemini,


What do you know about the garbage collector in java?

0 Answers   TCS,


How do you relate a Interface to a Class? Tell me in Detail?

4 Answers  


What is the range of the short type?

0 Answers  


tell me some common

2 Answers   TCS,


What is integer parseint?

0 Answers  


Write a program to find the greatest of three numbers in java?

0 Answers  


what is servlet enginee?

0 Answers   Covansys,


How thread scheduler schedule the task?

0 Answers  


What is java util concurrentmodificationexception?

0 Answers  


Explain the overview of UDP messaging.

0 Answers  


What is difference between module and function?

0 Answers  


Categories