Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Jesse Black   on Jul 03 In Java Category.

  
Question Answered By: Lee Butler   on Jul 03

If you declare a variable or method static  it means  that it is a class
variable or method. Then you can access it with something like

x = MyClass.staticVariable;

but if you don't declare it static you would have to use something like

MyClass obj = new MyClass;
x = obj.nonStaticVariable;

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Static keyword Or get search suggestion and latest updates.


Tagged: