Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diff b/w static final & final static

 
suman.pulikond a
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the actual Difference between the below two?

public static final String SEQUENCE = "sequence";

public final static String SEQUENCE = "sequence";
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Off to "Java in General (Beginner)."
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could even write

static final public String SEQUENCE = "sequence";

as far as the compiler is concerned.

It's a good idea to have a team wide coding standard that standardizes the order of the modifiers, though. Even better to use the Sun standard...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic