Gadgets

Tuesday, 19 February 2013

Naming conventions Rules and Special characters in java


Naming conventions Rules:-
1)      Package names in java are written in all small letters
  EX: - java.awt;
                      java.io;
                      javax.swing;
2)      Each word of a class name and interface name start with a capital letter.
EX: - String, DataInputStream, ActionListener
3)      Method names starts with a small letter, then each word starts with a capital letter.
EX: - readLine( ); , getNumberInstance( );
4)      Variable names also follow the above rules.
EX: - age, empName, employee_Net_Sal;
5)      Constants should be written using all capital letters.
EX: - PI, MAX-VALUE, Font.BOLD;
Here Font is a class, BOLD is a constant.
6)      All key words should be written in all small letters.
EX: - public, static, void, main etc…


Special Characters:-
  Charecter                                                                     Meaning
                \n                                                                       next line
                \t                                                                             tab
                \v                                                                              enter
                \b                                                                       back space
                \\                                                                                \
                \”                                                                               
                \’                                                                            


No comments:

Post a Comment