This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Vijay Tyagi wrote:
the KB book says
Instance variables can be public,private,protected,default,final,transient
They can't be abstract,static,strictfp,synchronized,native
Non local variables can be public,private,protected,default,final,transient,static, volatile
What are non local variables ?
It seems to me that non-local variables is the bigger pot that contains both instance variables and non-instance variables -- any variables that are not local to a block -- but of course I could be wrong.
I agree with the both of you. Which brings up an important omission in the first statement: "Instance variables can be public,private,protected,default,final,transient". They can also be volatile. Static is the only difference between instance variables and non-local variables - because static makes them class variables and no longer instance variables.