![]() ![]() ![]() Usually we can declare constants by using public static final modifiers. Should contain only uppercase characters and if it contains multiple words then these words are separated with underscore symbol. ![]() Should starts with lowercase alphabet symbol and if it contains multiple words every inner word should starts with upper case character.(camel case convention) Example: nouns length name salary age mobileNumber Coding standards for constants: Usually constants are nouns. Should starts with lowercase character and if it contains multiple words every inner word should starts with upper case letter.(camel case convention) Example: Coding standards for variables: Usually variable names are nouns. ![]() Cloneable these are adjectives Coding standards for methods: Usually method names are either verbs or verb-noun combination. 54 DURGASOFT, # 202,2ndFloor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038, 040 – 64 51 27 86, 80 96 96 96 96, 9246212143 | Core Java with SCJP/ OCJP Notes By Durga Sir Language Fundamentals Example: 1. Should starts with upper case letter and if it contains multiple words every inner word should starts with upper case letter. Example: Coding standards for interfaces: Usually interface names are adjectives. Should starts with uppercase letter and if it contains multiple words every inner word should starts with upper case letter. Example: Coding standards for classes: Usually class names are nouns. Whenever we are writing any component(i.e., class or method or variable) the name of the component should reflect the purpose or functionality. Example 4 : class Test Output: E:\\SCJP>javac Test.java E:\\SCJP>java Test \"Sai Charan\" Sai Charan 53 DURGASOFT, # 202,2ndFloor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038, 040 – 64 51 27 86, 80 96 96 96 96, 9246212143 | Core Java with SCJP/ OCJP Notes By Durga Sir Language Fundamentals Java coding standards Whenever we are writing java code, It is highly recommended to follow coding standards, which improves the readability and understandability of the code. Args) } } Output: E:\\SCJP>javac Test.java E:\\SCJP>java Test 10 20 1020 Space is the separator between 2 command line arguments and if our command line argument itself contains space then we should enclose with in double quotes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |