• Post Reply Bookmark Topic Watch Topic
  • New Topic

private static method signature  RSS feed

 
Charles HAN
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nothing.
 
Sloan Bowman
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David Harkness:
public, private, protected, synchronized, static, final, volatile, transient and awesome


Awesome?
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
Awesome?

Oh shoot, I'm injecting my personal attributes into the discussion again.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!