Monday, 12 March 2018

Java Naming Convention

Java naming convention is a simple rule to follow as a developer to decide what to name your identifiers such as class, package, variable, constant, method etc.

Here are rules to follow in Java regarding Naming Convention

Class name: It should start with an uppercase letter and be a noun e.g. Name, String, System, Thread etc.
Interface name: It should start with an uppercase letter and be an adjective e.g. Runnable, Remote, ActionListener etc.
Method name : It should start with lowercase letter and be a verb e.g. actionExecute(), run(), print(), println() etc.
Variable name: It should start with lowercase letter e.g. lastName, messageNumber etc.
Package name: It should be in lowercase letter e.g. impl, lang, sql, util etc.
Constants name: It should be in the uppercase letter. e.g. GREEN, YELLOW, MIN_PRIORITY etc.

Examples

Interface  Furnitures
Class Chair implements Furnitures
void changeName(Strung newValue);
void employeeNo(int value);
com.impl.programs.examples

Java strictly follows the camelcase syntax for naming the class, interface, method and variable.
Camelcase syntax: If name is combined with two words, second word will start with uppercase letter always e.g. actionExecute(), lastName, ActionEvent, ActionListener etc.

11 comments :

  1. Hello! To help you in this matter, I would like to recommend a resource, maybe is better to say the team, who can help you with the execution of assignments on any topic. When I finished my course dealing related to java, I turned to https://www.assignmentexpert.com/ service. Because they know good how to carry out the task, with their information skills, they have helped to me many times with such questions. During my study I close tree different subjects completely with their help.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. AWS Training in Bangalore - Live Online & Classroom
    myTectra Amazon Web Services (AWS) certification training helps you to gain real time hands on experience on AWS. myTectra offers AWS training in Bangalore using classroom and AWS Online Training globally. AWS Training at myTectra delivered by the experienced professional who has atleast 4 years of relavent AWS experince and overall 8-15 years of IT experience. myTectra Offers AWS Training since 2013 and retained the positions of Top AWS Training Company in Bangalore and India.

    IOT Training in Bangalore - Live Online & Classroom
    IOT Training course observes iot as the platform for networking of different devices on the internet and their inter related communication. Reading data through the sensors and processing it with applications sitting in the cloud and thereafter passing the processed data to generate different kind of output is the motive of the complete curricula. Students are made to understand the type of input devices and communications among the devices in a wireless media.

    ReplyDelete
  4. Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.

    Best AWS Training in Chennai | Amazon Web Services Training in Chennai

    AWS Training in Chennai | AWS Training Institute in Chennai Velachery, Tambaram, OMR


    AWS Training in Chennai |Best Amazon Web Services Training in Chennai


    AWS Interview Questions And Answers

    ReplyDelete
  5. Thank you for sharing such great information with us. I really appreciate everything that you’ve done here and am glad to know that you really care about the world that we live in
    Java training in Chennai | Java training institute in Chennai | Java course in Chennai

    Java training in USA

    Java training in Bangalore | Java training in Indira nagar

    Java training in Bangalore | Java training in Rajaji nagar

    ReplyDelete
  6. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    python Online training in chennai
    python Online training in bangalore
    python interview question and answers

    ReplyDelete
  7. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    excel advanced excel training in bangalore | Devops Training in Chennai

    ReplyDelete
  8. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. 

    angularjs Training in marathahalli

    angularjs interview questions and answers

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs online Training

    ReplyDelete