Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why not legal java ?

 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

?
 
Joe Ess
Bartender
Posts: 9279
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Identifiers are only valid within the scope they are declared. You declared i within the synchronized block, it is not accessible outside of the block. There's a detailed explanation of scope in the Java Tutorial
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic