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

What is java virtual machine? Explain

759


When can an object reference be cast to an interface reference in java programming?

758


What are desktop procedures?

781


Why can't you declare a class as protected?

787


What is gc()?

739


Do you know why doesn't the java library use a randomized version of quicksort?

721


Does hashset allow duplicates in java?

799


Can you instantiate the math class?

806


What super () does in java?

655


What is the use of toarray () in java?

762


What is stack example?

763


How is hashset defined in java?

713


What’s the difference between applets and standalone program?

731


What are the access modifiers available in java?

796


What is difference between float and double?

687