• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Variable Scope and Life time

 
Tharindu Priyath
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This program is correct.


But this program is compile error.Why
 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please look at a few threads in our “beginning Java” forum: 1 2 3 4.

Are there several people all in the same class who are struggling with this question? All those threads appear to be about the same question as you are asking here. They will also probably answer your question.
 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added code tags to your post, and you can see how much better it looks Please always use those tags.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic