File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface Question

 
Swapan Mazumdar
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please look at the code below:


Why the non-static method . can access public final static class variable LOW_GRAVITY? I understand that "you can't access non-static variable from a static method" but this scenario seems to be just opposite of the concept.
Why am I confused? I need some help
 
David Ulicny
Ranch Hand
Posts: 724
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is final and static. It cannot change the value and is accessible from everywhere everytime.
 
Ikram Soomro
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But you can access static resources anywhere in program (i.e. static and non static methods) as they belong to class.
 
Swapan Mazumdar
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David and Ikram...

I think I was a bit little more stressed out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic