Posted: Thu Apr 09, 2009 6:55 am Post subject: Static and non-Static methods
What is the different between static and non-static methods?
Sponsor Sponsor
[Gandalf]
Posted: Thu Apr 09, 2009 9:19 am Post subject: RE:Static and non-Static methods
Non static members belong to instances of a class, while static members belong to the class itself. For more information, read wtd's Introduction to Java.
matt271
Posted: Thu Apr 09, 2009 3:01 pm Post subject: Re: Static and non-Static methods
say u have:
Java:
publicclass SomeClass { publicstaticvoid someStaticMethod(){ System.out.println("this is a static method");
}
publicvoid someMethod(){ System.out.println("this is not a static method");
} }
then you would call them like this:
Java:
SomeClass.someStaticMethod();
SomeClass blah = new SomeClass();
blah.someMethod();
abogaida
Posted: Thu Apr 09, 2009 4:02 pm Post subject: RE:Static and non-Static methods