Posts

Showing posts with the label package

Coding conventions in java with example

Image
In previous post we have discussed about the data types in java. Now, we will discuss about the coding standards in java. Whenever we are writing code that is highly recommended to follow coding conventions. The name of the method or class should reflect the purpose of functionality of that component. Packages: Package declaration  should start with Lowercase letters. If you have tried creating the package with the Uppercase letter's, eclipse will show you the below warning message.  But, you can create the package by using uppercase letter also. For small projects that only have few packages, it's okay to just give them simple names which are meaningful. Ex: package com . javatbrains . sample ; package com . sun . java ; Classes: Class names should be nouns in “Capital Camel Case” . with the first letter of every word capital. After the first letter in the word you should use lower case letters. We can also create the class names which start w