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 does string intern() method do?
What is a java string?
Does java runtime require a license?
What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?
What is independent and dependent variables in research?
What is the main functionality of Prepared Statement?
What is java ceil?
What is the difference between Java and C++?
0 Answers Integreon, TCS, ZS Associates,
what is bytecode ?explain in detail and watz the difference between bytecode and machine code?
Why main() method is public, static and void in java ?
Give reasons supporting that string is immutable.
How does linkedlist work in java?