File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Head First Android 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: 19928

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.
I agree. Here's the link:
subject: Clarification on local variable scope.
It's not a secret anymore!