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 |
Which non-unicode letter characters may be used as the first character of an identifier?
Define interface?
What is Applet Stub Interface ?
What is nested loop? What is dangling else condition in it?
What is stack example?
What is the alternate of 'Inheritance' ?
Explain importance of inheritance in java?
Explain serialization and deserialization in java?
Explain polymorphism citing an example.
How many times garbage collector will invoke an object?s finalize() method?
What are parsers? Dom vs sax parser.
What will be the output of round(3.7) and ceil(3.7)?