|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Code Conventions for JAVA Coding Java program is simply the most understandable by all, and if you want to make your application easily distributable, it is necessary to adopt some standard rules of naming. The classes and interfaces: Class names match the names of their files. Java. On writing classes with lowercase first letter of each word within the class name in capital letters. Here, for example, class Macle be registered under the name MaClasse.java Code: public class Macle ( / / code ) Attributes: It adopts the following rule: the names of attributes are written in lowercase. Each first letter of a word written in capital letters, except for the first word. In practice, it shows the following: monAttribut public type; |
#2
| |||
| |||
Re: Code Conventions for JAVA Coding Constants: The constants are written in capital letters. We use the underscore _ to separate words: public final MA_CONSTANTE type = value; Methods: There is no specific rule regarding methods. In contrast, most of the time the conventions used for the classes are also used for methods. Try to be as descriptive as possible in the name of your method. |
#3
| |||
| |||
Re: Code Conventions for JAVA Coding Class/interface implementation comment (/*...*/), if necessary - This comment should contain any class-wide or interface-wide information that wasn't appropriate for the class/interface documentation comment. Class (static) variables - First the public class variables, then the protected, then package level (no access modifier), and then the private. Instance variables - First public, then protected, then package level (no access modifier), and then private. Methods - These methods should be grouped by functionality rather than by scope or accessibility. For example, a private class method can be in between two public instance methods. The goal is to make reading and understanding the code easier. |
![]() |
|
Tags: code, java |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
help me to understand java code (calendar java code) ? | so0oma | Software Development | 2 | 10-01-2011 12:01 AM |
java coding | unikshegz | Software Development | 1 | 27-10-2010 01:56 AM |
java coding for fibonacci series | Jagadamba | Software Development | 3 | 17-11-2009 10:44 AM |
Naming Conventions in java | Nihar Khan | Software Development | 3 | 12-08-2009 02:44 PM |
Type of Coding Conventions For Programming Languages | Joyjeet | Software Development | 4 | 27-02-2009 11:25 AM |