devxlogo

Tip Bank

Displaying PDF Documents

Need the ability to view a PDF document within a Javaapplet? Daniel F. Savarese, answered this question in the March 2000 issue of Java Pro. His solution involves using Adobe’s

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

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,

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)

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