clone() and the Cloneable Interface in Java
Most of the methods defined by Object are discussed elsewhere in this book. However, one deserves special attention: clone(). The clone() method generates a duplicate copy of the o
Read tutorialTHE TUTORIAL LIBRARY
Most of the methods defined by Object are discussed elsewhere in this book. However, one deserves special attention: clone(). The clone() method generates a duplicate copy of the o
Read tutorialThe arraycopy() method can be used to copy quickly an array of any type from one place to another. This is much faster than the equivalent loop written out longhand in Java. Here i
Read tutorialJava 2 adds to StringBuffer the ability to delete characters using the methods delete()
Read tutorialThe insert() method inserts one string into another. It is overloaded to accept values of all the simple types, plus Strings and Objects. Like append(), it calls String.valueOf() t
Read tutorialThe append() method concatenates the string representation of any other type of data to the end of the invoking StringBuffer object. It has overloaded versions for all the built-in
Read tutorialYou can concatenate two strings using concat(), shown here. The replace() method replaces all occurrences of one character in the invoking string with another character. The trim()
Read tutorialWhen Java converts data into its string representation during concatenation, it does so by calling one of the overloaded versions of the string conversion method valueOf() defined
Read tutorialIn general, Java does not allow operators to be applied to String objects. The one exception to this rule is the + operator, which concatenates two strings, producing a String obje
Read tutorialThe String class supports several constructors. To create an empty String, you call the default constructor. For example,
Read tutorialNative methods seem to offer great promise, because they enable you to gain access to your existing base of library routines, and they offer the possibility of faster run-time exec
Read tutorialAlthough it is rare, occasionally, you may want to call a subroutine that is written in a language other than Java. Typically, such a subroutine exists as executable code for the C
Read tutorialJava 2 adds a new keyword to the Java language, called strictfp. With the creation of Java 2, the floating point computation model was relaxed slightly to make certain floating poi
Read tutorialOne example today. A better developer tomorrow.