Learn4java
  • Java
    • Java SE
    • Java EE
  • DATABASE
    • Oracle/Sql
    • PL/SQL
  • Design
    • HTML
    • Java Scripts
  • How To...
Java SE JAVA :- JAVA CODING STANDARDS

JAVA :- JAVA CODING STANDARDS

Unknown
Java SE
15/08/2016
Hey everyone !!! In this section I am going to explain you about various standards which we are using in Java. Probably we can call all these as the back bone of this language.



In a Java Program we are using classes, interfaces, enums, methods, variables, package, constant and annotations.
Don't worry on the concept that what is class what is package what is method etc....in this article just draw your attention towards the naming convention , later I will elaborate each topic.
Now individually I am going to explain you how we can write class names or package names etc...

CLASS NAMES :-

In java all the class names must start with uppercase letters. If the classname contains multiple words every new word must start with a upper case letter. It is not must that we should start the next word of the class name with a uppercase letter but it is recommended.

Eg :- class String {
          // body of class
        }

         class BankAccount {
          // body of class
       }

INTERFACE NAMES AND ENUM NAMES :-

It is also very much similar to class names, all the interface names and enum names must start with a upper case letter. If the interface name and enum name contain multiple words then every inner word must start with upper case letter.

Eg:  interface Book {

       }

     enum IndianNavy {

     }

METHOD NAMES :-

In Java functions are called as methods, what we study in c as fuctions here in java it is called as methods.
All the method names must start with the lower case letters. If the method name contain multiple words then every inner word must be start with the capital letter

Eg :-
       getStudentDetails();
       setEmployee();
       deleteCustomer();


VARIABLE NAMES :-

In java variable names must start with the lowercase letters and if the variable name contains multiple word then every inner word must start with the upper case letter.
Again I will tell you that it is not necessary that every inner word must start with a upper case letter but it is the standard decided by java corporation so later if anyone else will be reading your code it becomes very easy for that person to understand it quickly.

Eg :-  class Student {
           int studentId;
           char studentName;
         }



PACKAGE NAMES :-

Package is like a folder which contains all the classes, here I am just considering its naming rule about the package we will understand it later.
In java all the package names contains only the lower case letters, it the package name contains multiple letter then the inner word will not start with the upper case letter, it will be continued with the lower case letter only.

Eg java.lang 
     java.swing
     java.sql
     java.awt

Classes are defined inside the class the package so it can be written as

java.io.BufferedReader

Here io is the package name and the BufferedReader is the class name.


Tweet
JAVA :- JAVA CODING STANDARDS Title : JAVA :- JAVA CODING STANDARDS
Description : Hey everyone !!! In this section I am going to explain you about various standards which we are using in Java. Probably we can call all the...
Rating : 5
← Newer Post Older Post ⇒ Home

Subscribe Us..!!

 Facebook   Twitter    Youtube

Translate

Categories

Java SE Oracle/Sql How To.. HTML Java EE Java Scripts

Popular Post

  • JAVA : Introduction of Data Types
    Hy guyz welcome, Todays Post is related to Data Types in Java, Well First We going to know about Data Types  So, Data Types ...
  • How to install Apache Tomcat Server in Windows
    Hy guys , welcome to Learnforjava.. for installing Apache tomcat server in windows this is the video link -  Install Apache...
  • ORACLE : How To Install Oracle 12c
    Welcome Guys To My Blog, So you Have Worked With Oracle 10g,11g. Now Feel More Experience and More Feature with Oracle 12c. Intr...
  • ORACLE :- Introduction to Oracle
    Welcome guys, Today's post for Oracle Introduction  What  is Oracle ? Oracle Database is an object-relational database manag...
  • HTML : Web Terminology and Its Type
    Welcome to LearnForJava  Today's Topic is About the term Web Terminology So, well there is Following type of web terminology ...
  • SQL : Introduction to Sql
    SQL  ( Structured Query Language ) is a special-purpose programming language designed for managing data held in a relational dat...

Visiters

2199

Followers

Contributors

  • Brajesh Sharma
  • Unknown
  • Unknown
  • abhishek
Copyright 2016 Learn4java - All Rights Reserved