Write code to find second largest number in an array of integers.
Questions
Search
List By Company
List By Topic
Legacy
Tests
Repository
DashBoard
Java
Java 8
Java 7
Java Abbreviations
OCJP / SCJP
Class List
New in Java 8
Java Exceptions
Spring Exceptions
Java Enums
Java 8 Lambda
Java 8 java.time
Big Data
Best Of Java
Discussion
Search
Subscribe
Search Interview Questions
More than 3000 questions in repository.
There are more than 900 unanswered questions.
Click here
and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company
Label / Company / Text
Search
Submit Question
Interview Questions and Answers
Q1.
Write code to find second largest number in an array of integers.
Core Java
Ans. int arr[]={1,3,5,6,4,8,9,2,10};
Arrays.sort();
System.out.println(arr[arr.length-1]);
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 code  coding  find in array
Asked in 1 Companies
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Related Questions
Why Char array is preferred over String for storing password?
What is the difference between ArrayList and LinkedList ?
If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ?
Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ?
Which of the following is false about main method ?
a. It should be declared public and static
b. it should have only 1 argument of type String array
c. We can override main method
d. We can overload main method
If arrays cannot be resized , Why is this code valid
String[] strArray = new String[2];
strArray = new String[5];
Difference between Vector and ArrayList ?
What are the disadvantages of using arrays ?
What are the Disadvantages of using Collection Classes over Arrays ?
Advantage of Collection classes over Arrays ?
Help us and Others Improve. Please let us know the questions asked in any of your previous interview.
Any input from you will be highly appreciated and It will unlock the application for 10 more requests.
Company Name:
Questions Asked: