aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes confusion with output... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "confusion with output..." Watch "confusion with output..." New topic
Author

confusion with output...

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362

output is:int,int...

why it is choosing method1 eventhough it is having two parameters?

if i uncomment method2 it select that and giving output as int.

can you tell me the reason?


SCJP5 and SCWCD1.5
Think Twice Act Wise...
ramesh maredu
Ranch Hand

Joined: Mar 15, 2008
Posts: 210

Hi Ganesh,

I was also not sure about it so i decompiled it with jad it generated below code with doSomething(int i) commented


if you uncomment it generates the below code.



SCJP 1.5 94%.
The greatest glory in living lies not in never falling, but in rising every time we fall.
subhasish nag
Ranch Hand

Joined: Apr 25, 2008
Posts: 101
That is because var args expect from 0 to many ints parameter.
[ November 02, 2008: Message edited by: subhasish nag ]

Thanks,<br />Subhasish
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
hi ramesh.
transient keyword is used for only instance variables.

check in your code..
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
yes you are right subhasish.
ramesh maredu
Ranch Hand

Joined: Mar 15, 2008
Posts: 210

transient keyword is used for only instance variables.


Yes, you are correct, I don't think decompilers can generate exact code but we can get some idea from the generated code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confusion with output...
 
Similar Threads
Doubt in Mock Question
How the increment work
need help in overloading...
Instance Method/Static Method/Field Hiding
Exception Handling