write java code to print second max number in the array

Answer Posted / sunny

I think, the except for Himesh's program, all other ones
doesnt handle duplicate values ...
I mean if the numbers are :- 9 9 8 8 7 7 7 1 3 2
the answer should be 8 ideally.
But I doubt whether thats really happening in any other
programs, except for Himesh's.
Do let me know, if I am wrong. Thanks.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you sort in java?

614


What are the differences between string, stringbuffer and stringbuilder?

535


What is finalize()? Is finalize() similar to a destructor?

553


How do you reverse a word in java?

537


What is mnemonic code?

557






What do you understand by final value?

596


What two classes are used to read data only?

647


What is the gregoriancalendar class in java programming?

577


What is string english?

554


What does a method signature consist of?

521


Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).

1611


What are keywords in programming?

572


Is arraylist dynamic in java?

533


How is it possible for two string objects with identical values not to be equal under the == operator?

536


Why do we need hashmap in java?

569