devxlogo

October 12, 2002

Outputting Currencies

How to print out a Currency in Java is an often overlooked topic. How should Currency be printed out in an international, standardized way?The java.text.NumberFormat class is used for outputting

Copy Data from One File to Another

This wrapper class “FileCopier” copies data from one file to another. This class uses another class: “StreamCopier”. /** * Class: FileCopier * Author: Vivek Bagade * Date: 8/31/2001 * Description:

Generate Thumbnails Out of a Larger Image

This is useful in a Web-based Photo Gallery kind of application, where you need to automatically generate multiple sizes of the same image. class ThumbnailGenerator { public void generateThumbnail (String

A Cleaner Way of Doing String Comparison

If you have a method into which you pass a String parameter that you compare with another string then: void foo( String str ){ String CONST_STR = “bar”; // DON’T