write java code to print second max number in the array
Answers were Sorted based on User's Feedback
Answer / rajesh s
If we give negative values, what would be the Rajaraman
code begaves????
| Is This Answer Correct ? | 0 Yes | 1 No |
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 |
What is memory leak and how does java handle it?
what is the form of storage space in java?
What is hash table in java?
What are the data types supported by java?
What is JAVA? Why it is platform independent?
What is a stringbuilder?
what is synchronization and why is it important? : Java thread
what is the need of the Ajax?
Why is static used?
What is array and arraylist in java?
When parseint method can be used?
Can interface be private in java?