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 |
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
What does the “static” keyword mean? Can you override private or static method in java?
Is boolean a data type in java?
What is the purpose of the wait(), notify(), and notifyall() methods in java programming?
What is the range of a character variable?
Functionality of JVM?
What is tochararray in java?
Does a function need a return?
How a class can implement an interface?
Does apple use java?
How many bytes is a character?
What do you understand by abstract classes?