Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-05-2009
kex kex is offline
Member
 
Join Date: May 2008
Posts: 143
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;
Reply With Quote
  #2  
Old 06-05-2009
kex kex is offline
Member
 
Join Date: May 2008
Posts: 143
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.
Reply With Quote
  #3  
Old 06-05-2009
Member
 
Join Date: Oct 2008
Posts: 20
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Code Conventions for JAVA Coding"
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


All times are GMT +5.5. The time now is 06:05 PM.