answersLogoWhite

0

Some simple and basic guidelines for writing java programs are:

  • Always initialize variables before using them
  • Do not declare unused variables especially collections
  • Always check for null before performing operations on objects
  • Do not catch unwanted exceptions
  • Use a logging mechanism instead of using printStackTrace()
  • Use loops only when required and add proper loop termination conditions
  • Do not duplicate code. Try to re-use code as much as possible
  • Always add comments to the methods
  • Do not code huge classes. Keep classes limited to 700 lines of code
  • etc.
User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is the Java grammar?

"Java grammar" is the way of writing a program with correct syntax of various commands used in java language.


What is writing a program in a language such as C or Java is known as?

It is known as 'programming'.


What is a java programming?

A java program is a program that is coded and run in the programming language called java. Java is similar to c++ in structure, and is more common in web apps. C++ is the equivalent for more heavy duty programs such as most software used to compose a java program.


Writing a program in a language such as c plus plus or java is known as what?

Object Oreinted Programming


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.


How do you create and execute a java program?

You can create a Java program by writing it in any text editor - for example Notepad, or Notepad++. You can compile it with the "javac" command, and, if it compiles without errors, run it with the "java" command. Or better, simplify your life by installing an IDE (integrated development environment), such as Netbeans or Eclipse.


What are the different phases of java?

Based on the lecture i have , there are three JAVA PHASES -- editor. First step in creating java program is by writing ur programms in a text editor. Ex, notepad, emacs etc -- java compiler. compile. The program by. Using the java compiler. The output of this process is a file of java bytecodes wid the file extension.class -- java interpreter. The .class file is then interpreted by java interpreter that converts the bytecodes into the machine language of the particular computer your using ---abioo4---


What is java program on computers?

#!/usr/bin/perl print 'java program';


What is java virtucal mechine?

That refers to the program that runs the compiled Java program.


What powder game doesnt need java?

Any program written for the Java technology needs Java. Any program NOT written for Java DOESN'T need it.


Where can one get the program Java?

The program Java can be downloaded from the official Java website on the internet. The program is free for personal use, so it can be downloaded without any cost by anyone.


What is a Java applet?

PCH answer small Embedded Java Program.