File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confusion with output...

 
Ganeshkumar cheekati
Ranch Hand
Posts: 362
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
ramesh maredu
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
subhasish nag
Ranch Hand
Posts: 101
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is because var args expect from 0 to many ints parameter.
[ November 02, 2008: Message edited by: subhasish nag ]
 
Ganeshkumar cheekati
Ranch Hand
Posts: 362
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ramesh.
transient keyword is used for only instance variables.

check in your code..
 
Ganeshkumar cheekati
Ranch Hand
Posts: 362
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes you are right subhasish.
 
ramesh maredu
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic