devxlogo

March 28, 2000

Getting Around Global Variables

In many programming languages such as C or Pascal,most users have come across global variables.Like this C example: int GlobVar = 0; // Global variable void f(int x) // Function

Be Careful When You Cast

Java allows you to cast variables, or change them from one variable type to another. However, it’s important to make sure that the final variable type can store all the

Resolution of Overloaded Functions

Let’s say we have an overloaded function called fun(): void fun(string) { system.out.println(“String”); }void fun(int) { system.out.println(“Int”); }void fun(double) { system.out.println(“Double”); }void fun(float) { system.out.println(“float”); } If we call fun(37)

Handling Complex Initialization

Complex initializations need only be done once and the result stored for later use. For example if you need to create a list of integer values and then load them,

Internationalization and Formatting numbers

You can consider Java to be a strong language with respect to internationalization and number formatting. Sometimes you might wish to format numbers in a specific locale or given a

Display Integers Without Commas in JTables

If you have a JTable where the values displayed in a particular columnare Integer objects, it will display the Integer values with commas(e.g. 98765432 is displayed as 98,765,432) if these