Professional Documents
Culture Documents
to be followed by a Java Developer | JAVAbyNATARAJ
JAVAbyNATARAJ
Learn CoreJava and advanced concepts in simple steps. This blog is maintained by Nataraz sir students from DurgaSoft and SathyaTech,Ameerpeta,Hyderabad.
Home CoreJava Jdbc Servlets Jsp Struts Hibernate Download Contact Us
SEARCH THIS BLOG
Search
Guidelines to be followed by a Java Developer
>> SATURDAY, JULY 19, 2014
SUBSCRIBE VIA EMAIL
Every java developer has to follow Subscribe
qualitysoftware. In the Coding
standards Oracle(Sun) has given
some set of rules in java and the
developers must follow.Standards
lead to consistency and help
software engineers avoid common
problems. A development
environment that uses Java
standards has the following
advantages:
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 1/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
1. Developers can view any Java software and quickly figure out what is going
on.
2. Developers new to Java are spared the need to develop a personal style.
3. Developers make fewer mistakes in consistent environments.
4. Discussions about the appropriateness of a language feature are reduced at
code reviews.
The List of Guidelines given below.
Rule 1 Always place the public class or interface in a file as the first class.
Rule 2 Always use explicit import statement.
Rule 3 Do not use numbers as words in names.
Rule 4 Do not capitalize any letter other than the first for all words in a POPULAR POSTS
name.
Rule 5 Use full English descriptors that accurately describe the DurgaSoft SCJP Notes Part-I
variable/field/class/interface. For example, use names like firstName, Download
grandTotal, or CorporateCustomer.
Rule 6 Do not remove letters from words, except to create standard short
forms. DurgaSoft OCJP(SCJP) Notes Part-II Download
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 2/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
Rule 7 Do not use the long form of a word when a standard short form
exists.
Rule 8 Always include units in a name when the name refers to an entity
with units.
Rule 9 Do not use acronyms in names unless the acronym is industry Core Java notes by Mr.Ratan from
standard or is defined in user documentation. Durgasoft
Rule 10 Always treat acronyms as words when applying other naming rules.
Rule 11 Always capitalize the first letter of class name.
Rule 12 Do not include any prefix or suffix to indicate that a name is for
Advaced Java Notes by Mr.Nataraj
any specific type.
from Ameerpeta
Rule 13 Do not include anything in a name to indicate that the name is for
a class.
Rule 14 Do not include underscores in names, except after a member’s
164 Java Interview Questions by
prefix.
Nageswara Rao
Rule 15 Do not pluralize type names except collections.
Rule 16 Use abbreviations sparingly, but if you do so then use then
intelligently and document it
For example, to use a short form for the word “number”, choose one of nbr, Download Spring material from
no or num. DurgaSoft
Rule 17 Always start a method name with a lowercase letter.
Rule 18 Always start method names with a verb.
Rule 19 Always use the following verb opposite pairs when methods Spring AOP & MVC notes by
perform opposite actions. Mr.Sekhar sir
Rule 20 Always use the method caller as the frame of reference.
Rule 21 Always include a prefix on field names.
Rule 22 Always ensure that the first letter after a field’s prefix is in Spring notes by Mr.Nataraz from
lowercase. Sathya Technologies
Rule 23 Always include white space between a keyword and an open
bracket when the keyword occurs first.
Rule 24 Always include white space before and after binary arithmetic,
Struts Flow and Architecture
equality, relational, logical, assignment, and bitwise operators.
Rule 25 Do not include white space between a unary operator and its
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 3/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
operand.
Rule 26 Do not include white space before the open bracket in a method
declaration, method call, open array subscript, or indexer.
Rule 27 Always include white space after a comma.
Rule 28 Always include white space after a semicolon in loop control Web Services Notes by Nataraj sir
statements. from Sathya Technologies
Rule 29 Always indent new scope three additional spaces.
Rule 30 Do not use tabs.
Rule 31 Do not ignore checked Exceptions
Rule 32 Always indent the second line and subsequent lines of a multiline
statement an additional six spaces from the first line.
Rule 33 Always break each line of a multiline statement immediately
following a comparison operator.
Rule 34 Always put braces around statement blocks of control statements
even if the block is empty or a single line.
Rule 35 Always align an opening brace immediately under the first
character of the corresponding keyword. BLOG ARCHIVE
Rule 36 Always align braces vertically.
► 2016 (2)
Rule 37 Do not nest if/else statements more than 3 levels deep
► 2015 (6)
Rule 38 Do not include more than one statement per line.
▼ 2014 (37)
Rule 39 Do not include more than one variable declaration per line.
Rule 40 Do not use brackets when a return statement returns a simple ► December (2)
software being documented. Download
Rule 46 Do not use endofline comments.
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 4/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
Rule 60 Always declare constructors before any other method, starting with
the default constructor if applicable.
Rule 61 Always use an initializer when a member variable is always
initialized to the same value.
Rule 62 Always override Object.toString() in a userdefined class.
Rule 63 Do not overload operators unless it is completely obvious what the
operator does to the class.
Rule 64 Always override hashCode when you override equals
Rule 65 Do not compare boolean values to true or false to create Boolean
expressions.
Rule 66 Do not hardcode strings that are presented to end users.
Rule 67 Always use the form: Type[] name to define an array
Rule 68 Do not use interfaces to define a “constant interface”.
Rule 69 Always comment when a cast is used to convert between value
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 5/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
types.
LABELS
Rule 70 Always use the method equals to compare objects for equality.
ActionServlet (1) Advantages (1) AdvJavaBooks (7) Ajax
Rule 71 Always use enhanced for loop for simple loop implementations (1) AOP (1) Architecture (2) ArrayList (1) Arrays (4)
Atlassian (2) Basic Java Programs (1) Basic JavaPrograms
Rule 72 Always postpone variable definitions as long as possible. (1) BufferedReader (2) ClassNotes (2) Coding Standards
Rule 73 Do not use the same variable for multiple purposes. (1) Collections (20) Con guration (3)
Rule 74 Do not modify a loop index variable inside a for loop. ConnectionPooling (1) CoreJava (67)
CoreJavaBooks (10) CSV File (1) CVS (2) DAO (1)
Rule 75 Do not create more than one main method in a single package Database (1) DataStructure (1) Decorative (1)
Rule 76 Every switch statement should include a default case. The break in Designpatterns (6) Developer (1) Differences (2)
Rule 84 Always add the "Exception" suffix to the name of types derived
from java.lang.Exception.
GOOGLE+ FOLLOWERS
Rule 85 Always declare each checked exception that can be thrown
Muralidhar Nayani
individually
Add to circles
Rule 86 Always throw unchecked Exceptions if the error is not recoverable
by the caller.
Rule 87 Always include failure information in an Exception detail message
that contains the values for all parameters and fields that contributed to the 286 have me in circles View all
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 6/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
exception.
Rule 88 Do not use assertions in nonprivate methods.
If you found any mistake or wrong statement from the above, please
comment below to correct it.
Reference Books:
Core JAVA : An Integrated Approach 1 Edition
Core Java : Advanced Features (Volume 2) 8 Edition
Core JavaServer Faces 3 Edition
SCJP Sun Certified Programmer for Java 6 Study Exam 310
Posted by Muralidhar Nayani at Saturday, July 19, 2014 2 Comments
Labels: Coding Standards, CoreJava, Java Standards
2 Comments JAVAbyNATARAJ
1 Login
Join the discussion…
Affity Solutions • 3 years ago
Thanks for your ideas. You can also find the details on Affity Solutions, at the
Java Developers. The main object of the Affity Solutions is to provide quality
web services and is among the few software development company in Nagpur.
△ ▽ • Reply • Share ›
As per Jim Halvorsen comment i have corrected some of the points and
modified the title from 'rules' to Guidelines'. Thanks Jim.
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 7/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
modified the title from 'rules' to Guidelines'. Thanks Jim.
△ ▽ • Reply • Share ›
ALSO ON JAVABYNATARAJ
Default value of primitive data types Static Import in Java with an
in Java Example
1 comment • 2 years ago• 1 comment • 2 years ago•
Ginger Sanches — Now I understand Jumbodium — Informative share.
the main process of working of Liked the post. Thank u for the
primitive type of Java. Even if … share.
July 2014 Best practice to find Duplicate
1 comment • 3 years ago• Character from a String in java
Siddu Siddharth — 2 comments • 2 years ago•
ieeeprojectshub.blogspot.in Mdhar — make sure all your jars with
versions are configured properly.If
you provide your …
javac.in Basic Struts Login Application
DurgaSoft SCJP Notes PartI Download
Web DevelopmentTips,Tutorials & Books strutsconfig.xml in Detail
What are the Different types of DurgaSoft OCJP(SCJP) Notes PartII
ABOUT AUTHOR
FormBeans in Struts? Download
Muralidhar Nayani How ActionServlet acting as a
Hi this is Muralidhar, i am living in FrontController Core Java notes by Mr.Ratan from
Chennai. I have been working in Java and Struts configuration file Durgasoft
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 8/9
2017524 Guidelines to be followed by a Java Developer | JAVAbyNATARAJ
© javabynataraj.blogspot.com from 2009 2014. All rights reserved.
http://javabynataraj.blogspot.in/2014/07/listofguidelinestofollowjava.html 9/9