September 24, 1997

DevX - Software Development Resource

Helping the Java Garbage Collector

When you create an object in Java, such as in the following code: Button b = new Button(); Java creates a new Button object in memory and sets the value

DevX - Software Development Resource

Include Test Code in Your Classes

It is important for developers to test code that they write to insurethat they are meeting the specifications for their application. Oftentest code is built in a separate program which

DevX - Software Development Resource

Allow the Java Compiler to Remove Debug Code

The Java compiler will optimize your application by removing code thatcan never be executed. If you include a class in your application suchas the following: public class Debug{ public static

DevX - Software Development Resource

Increase Code Reusability

Instead of exposing fields of a Java class, such as in thiscode: public class Person{ public String firstName; public String lastName;} use private fields and provide access to the information