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: Mildred Bailey   on Jul 03

It means  that the field or method is accessible via the class. Example:


public class Thing{

public static  void staticMethod(){ }

public void instanceMethod(){ }

}


The method staticMethod() can be accessed via Thing.staticMethod() and
you don't need an object, whereas with the instanceMethod() you would
first need to create an instance of MyClass to access the method:

Thing thing = new Thing();
thing.instanceMethod();

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: