wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Please Explain Why Output is so? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Please Explain Why Output is so?" Watch "Please Explain Why Output is so?" New topic
Author

Please Explain Why Output is so?

vishal mishra
Ranch Hand

Joined: Jul 12, 2010
Posts: 103
Namaste !! to all Friends

I have found a question in a document which i have downloaded from the site www.examcertify.com

Question is-:

Output given-:[2, 5, 3, 1]

I have compiled the program and executed it.It is giving the same output.
According to me output should be [5,3,2,1].
Please Explain me Why output is not what i thought...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41062
    
  43
Let's turn around and ask you: why do you think the output should be [5,3,2,1]?


Ping & DNS - my free Android networking tools app
vishal mishra
Ranch Hand

Joined: Jul 12, 2010
Posts: 103
Thanks !! I got it !!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Please Explain Why Output is so?
 
Similar Threads
can we add primitive variables in ArrayList or just objects?
dragdrop-colections
Binary insertionSort with ArrayList
Teaching without primitives
Generics