September 12, 1998

Classes in sun.* packages

All the classes in sun.* that accompany the Sun JDK are provided assupport classes that are used to implement specific sets of functionalityfor the core JDK classes. The classes in sun.* such as not have fixed API’s, nor are they in any way a standard part of theJava language.

Converting a String into an int

The Java core API possesses a method equivalent to the C atoi() function in Java. The java.lang.Integer class contains a method called parseInt()which will convert a String into an int. The Float, Double, and Longclasses also contain analogous methods to convert strings into numbers.They also contain toString() methods to perform

Generating Random Numbers

The java.util package contains a class called Random which you can useto generate random numbers. A Random object represents a repeatingpseudo-random sequence of numbers. You can either fetch the next actualpseudo-random number with the next() method or fetch a uniformly distributedfloat, double, int, or long value using nextFloat(), nextDouble(), nextInt(),or

Array Reflection

The java.lang.reflect package provides an Array class through whichthe values of an array can be accessed. It is usually more effectiveto cast the array after it has been obtained through reflection, butthere are circumstances where that may not be possible. To access thevalues of an array through reflection, you must

Numerous Access Specifiers in a Class Can Improve Readability

There is no limit to the number of access specifiers (private, protected, and public) a class can have. When large classes are declared, it is useful to repeat the access specifier frequently to improve readability. You can also group class members logically. For example, you can declare all constructors under

Navigator Does Not Support the onMouseOver Event for Images

If you are trying to make an alert box that displays a message when the user passes the mouse over an image, keep in mind that unlike Microsoft Internet Explorer, Netscape Navigator doesn’t support the onMouseOver event for images. However, Navigator does support the event for anchor () tags. The

Java Arrays

C programmers are used to dealing with multidimensional arrays as chunksof contiguous memory which can be accessed through pointer arithmetic.In Java, an array is an actual object, and a multidimensional arraymust be constructed as a an array of arrays. It is an extremely convenientarrangement because you can access the length

Components Help Team Based Development

Aside from fitting well with the Microsoft environment, creating components and component based software also works well with the management and tracking of development teams. Components naturally divide into manageable granular pieces that can easily be assigned to one developer or a small team–avoiding large, single line items in the

Performance Monitor Defaults

On NT, do you ever wonder why Performance Monitor starts up blank on some computers, and others have process monitored automatically upon start up? Well, Performance Monitor first looks for a file called _default.pmc in the startup directory and will use this as its settings if it finds the file.

No more posts to show