s begri wrote:Thank you all,
Shanky Sohar could you please describe what t is declared static final so that it will be a compile time constant.. mean and how it is effect on the application ?
regards,
S
Static : it is available without instantiating the class.
Final : for Preventing the inheritance further ie; the class with final
word as prefix cannot be extend further!.
So here
means logger is been decided as the reference of the Hello.class itself at the compile time and its final,you cann't change it to something else.
For a complete application,logger remain as the reference to a hello.class,you cann't change.
if you are not marking it as static then it will be initialed at runtime or if you are not marking it as final then within a class itself you can change the reference of it to
something like
logger = Logger.getLogger(Hello.class);
And you are marking it as private,as you don't want any other class can use this logger just because it is static and cab be access using classname..
So syntax is..
Hope now completely understood..