Results 1 to 3 of 3

Thread: Code Conventions for JAVA Coding

  1. #1
    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;

  2. #2
    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.

  3. #3
    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.

Similar Threads

  1. help me to understand java code (calendar java code) ?
    By so0oma in forum Software Development
    Replies: 2
    Last Post: 10-01-2011, 12:01 AM
  2. java coding
    By unikshegz in forum Software Development
    Replies: 1
    Last Post: 27-10-2010, 01:56 AM
  3. java coding for fibonacci series
    By Jagadamba in forum Software Development
    Replies: 3
    Last Post: 17-11-2009, 10:44 AM
  4. Naming Conventions in java
    By Nihar Khan in forum Software Development
    Replies: 3
    Last Post: 12-08-2009, 02:44 PM
  5. Type of Coding Conventions For Programming Languages
    By Joyjeet in forum Software Development
    Replies: 4
    Last Post: 27-02-2009, 11:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,033,341.19012 seconds with 16 queries