permaculture playing cards*
The moose likes Beginning Java and the fly likes Clarification on local variable scope. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Clarification on local variable scope." Watch "Clarification on local variable scope." New topic

Clarification on local variable scope.

Eric Larsen
Ranch Hand

Joined: Mar 28, 2009
Posts: 35
Just for some clarification on the scope of local variables:

Will this compile?
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Do you think it will compile?

Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Henry Wong

Joined: Sep 28, 2004
Posts: 18545

Will this compile?

From your question, I think you already know that it won't -- and you know why too.

Why don't you just take a minute and actually compile it?


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Eric Larsen
Ranch Hand

Joined: Mar 28, 2009
Posts: 35
Thanks. I would do it myself, but I'm over at my Grandma's house. I'm using her computer and I didn't want to take the time to install the jdk on it. I have my Head First Java with me though and am reading through ch9.
wood burning stoves
subject: Clarification on local variable scope.
Similar Threads
Question Bank ID : 41
same variable name for instance and local variable
Why doesn't named classes classes doesn't insist on final parameter variable?
using temporary variabel
Variable with Same Name