MBA-IT.com
Welcome About us Blogs News Contact Us Privacy Policy Terms Of Use  
Advertising
Business Research
Economics
Marketing
Human Resource Management
Software Engineering
Java

Start

Java Concepts

Java Data Types

Java Syntex

HelloWorld.java

PHP
 

 Blogs > Java > Java Syntex

Java Syntex - Java Naming Convention & Coding Style

Introduction to Java Syntex

Now let's start for the real java programming but before that we must have some breif introduction to common java language syntex

Coding Style:
Java language source code is written in blocks. These are class block, procedure block, loop block and if statement block. And these blocks are started with "{" and end with "}" so two styles exists for writting a block of soruce code

  1. function block()
    {
          //function statements here...
          //function statements here...
    }
  2. function block() {
          //function statements here...
          //function statements here...
    }

Java Naming Conventions:
There are two major coding styles exist in the real world, WordCase and nounCase

  • In WordCase, the first letter of every identifier used in programing is Capitalized. e.g StudentName, AccountName
  • In nounCase, only the first letter of a noun is capitalized. e.g studentName, accountName

Coding conventions always exist for programming languages, so java has a common style of mentioning java conventions too. Following are some list of java conventions used for java

  • The names of classes in java are written as single Noun with first letter capital. e.g. class Students, class Accounts
  • Member functions names are written in nounCase
  • Local vairables has no prefinx against there names like variables in a local "if" statement or "for" loop, but variables which donot belong to local scop should always be prefixed with something that help in reading the source code. It can either be firstletter(s) of it's class name

 

© 2005 -2010 MBA-IT.com, All Rights Reserved

Contact us | Privacy | Terms of Use