Difference between Private mand Private Static

Within a class, what's the difference between a prviate method and a private static method?If it was public or protected, we could still access a static method but why would we declare a prviate static method when the method can not be called by other classes? Thx.
[280 byte] By [SheepSheepa] at [2007-11-26 23:41:21]
# 1

> Within a class, what's the difference between a prviate method and a

> private static method?

The first is not static, the second is.

> If it was public or protected, we could still access a static method

I'm not sure what this means. A method - private/public/protected - can

always be accessed, just from different places.

> but why would we declare a prviate static method when the method

> can not be called by other classes?

It would be suitable for a static method that was only going to be

accessed from within the class. Note that such a method can be called

from within a "static context" (like main()) while a non static private

method can't be.

Also a method could be considered static on semantic grounds - if it

only does static (class wide) things.

pbrockway2a at 2007-7-11 15:08:52 > top of Java-index,Java Essentials,Java Programming...
# 2
What is the difference between private and private static variable
om_pancholia at 2007-7-11 15:08:52 > top of Java-index,Java Essentials,Java Programming...
# 3
> What is the difference between private and private> static variableWell, do you know what private means?Do you know what static means?
jverda at 2007-7-11 15:08:52 > top of Java-index,Java Essentials,Java Programming...
# 4
http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html
DrLaszloJamfa at 2007-7-11 15:08:52 > top of Java-index,Java Essentials,Java Programming...