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 meant by 'bit masking' in java?
What is considered an anti pattern?
In a class implementing an interface, can we change the value of any variable defined in the interface?
What is abstract class? Explain
What is :: operator in java?
Can a class have an interface?
What is the base class of all exception classes?
How is java hashmap implemented?
Is main an identifier?
How to handle a web browser resize operation?
Can we declare main () method as non static?
What is a string token?