Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

argh.. method intiliazation?

 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

To my suprise it prints out
j=3
jj=4
3
Why does jj get initialized? i'm not sure where in the JLS i should look. Any help appreciated
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there you go:
12.4.1 When Initialization Occurs
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Valentin
Where can i get more practice questions on this particular aspect?
TIA!
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know but what you could do is write your own code or take that example and tweak it in all possible ways... It's a good exercise...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic