Tip Bank

DevX - Software Development Resource

The Best Way to Manipulate Strings in C++

You should use the String class to avoid common problems when manipulating strings in C++. The following approach will work, but it needs a lot more code to make it

DevX - Software Development Resource

Convert a Double into an Int

There are many things you can do to convert a float to an int depending upon what results you expect. If you want to use the built-in language conversions, you

DevX - Software Development Resource

Send Output to Printer

How do I send the output of my program to the standardprinter installed in Win95 or NT? Is it possible using the

DevX - Software Development Resource

Replicating the END command in C++

Suppose I have one function that calls about five or so subfunctions. In one of the subfunctions, I have an if statement: that if a=0, go on to the rest

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