Tip Bank

DevX - Software Development Resource

Error Handling and Corrections

The following is an example to handle errors in VB. It combines “On ErrorGoTo” and “On Error Resume Next” to handle all errors (minor orserious ones), as well as attempting

DevX - Software Development Resource

How to See If Data is Numeric or Non-numeric

In JavaScript you can use isNaN to check if the given data is numeric ornon-numeric.Syntax : isNaN(testdata)ReturnValue :True if the testdata is non-numeric.False if the testdata is numeric.Here’s an example:

DevX - Software Development Resource

Methods of Class Instantiation

The following methods can be used for creating new instance of your classes, depending on your specific needs. import java.lang.ClassLoader;import java.net.URLClassLoader;import java.net.URL;public class InstantiateClass { testFinally newInstance() throws Exception {

DevX - Software Development Resource

Using Verbose to Debug

Using the -verbose option during compilation and execution is very helpful&#151both for obtaining more information about the classes being loaded by the compiler and the interpreter and to find out

DevX - Software Development Resource

A Problem in Using Enumeration

Once you are finished iterating through the values of an Object implementing the Enumeration interface, the next time youtry to use hasMoreElements() it will return false. Many developers are not

DevX - Software Development Resource

How to Rethrow an Exception in Your Code

Use the fillInStackTrace() method to rethrow a Throwable type of exceptional condition in your code. This is useful if you want to rethrow a exception occurred while using a method

DevX - Software Development Resource

Creating a Numeric-Input JTextField

Validating user input that is typed into a JTextField can becumbersome, especially if the input string must be converted to anumeric value such as an int. By subclassing JTextField, however,

DevX - Software Development Resource

Boolean Literals

The keywords false and true are Boolean literals that evaluate to 0 and 1 respectively. Note that in other programming language, VB for instance, false equals -1 and true equals