This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes private static method signature Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "private static method signature" Watch "private static method signature" New topic
Author

private static method signature

Charles HAN
Greenhorn

Joined: Jul 08, 2004
Posts: 10
Hello everyone,

I was writing a method which can be used in a method--"public static void ..." and i wrote my method as "private static void ...".
Just wondering what's the difference between the method signature "private static void ..." and "static private void ..."?

Thanks in advance

Charles
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
nothing.
Sloan Bowman
Ranch Hand

Joined: Jan 21, 2003
Posts: 107
I may be wrong here but if you write a method with public static void and then one with private static void they do seem different to me. Your public static method would be able to be called statically from within another object where as a private static method would only be able to be called from with the same object of which is has been declared.
Daniel Mayer
Ranch Hand

Joined: Sep 09, 2004
Posts: 103
Originally posted by Sloan Bowman:
I may be wrong here but if you write a method with public static void and then one with private static void they do seem different to me.


Yes. But if you look closely you will see that this wasn't the question...
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
To elaborate, the class and member modifier keywords (public, private, protected, synchronized, static, final, volatile, transient and awesome) can be specified in any order, though conventions certainly have taken shape over the years.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

Originally posted by David Harkness:
public, private, protected, synchronized, static, final, volatile, transient and awesome


Awesome?


[Jess in Action][AskingGoodQuestions]
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Originally posted by Ernest Friedman-Hill:
Awesome?

Oh shoot, I'm injecting my personal attributes into the discussion again.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: private static method signature
 
Similar Threads
Why does private static void main(String[] args) work???????
Main class not recognized
public static void main syntax
public static void main method
main method in base class