In safe environments, you can use Java to execute other heavyweight processes (that is, programs) on your multitasking operating system. Several forms of the exec() method allow yo
Read tutorial ↗Although Java provides automatic garbage collection, sometimes you will want to know how large the object heap is and how much of it is left. You can use this information, for exam
Read tutorial ↗One of the most common programming chores is converting the string representation of a number into its internal, binary format. Fortunately, Java provides an easy way to accomplish
Read tutorial ↗Float and Double provide the methods isInfinite() and isNaN(), which help when manipulating two special double and float values. These methods test for two unique values defined by
Read tutorial ↗The method toLowerCase() converts all the characters in a string from uppercase to lowercase. The toUpperCase() method converts all the characters in a string from lowercase to upp
Read tutorial ↗The valueOf() method converts data from its internal format into a human-readable form. It is a static method that is overloaded within String for all of Java's built-in types, so
Read tutorial ↗You can extract a substring using substring(). It has two forms.
Read tutorial ↗These two methods are overloaded in several different ways. In all cases, the methods return the index at which the character or substring was found, or 1 on failure.
Read tutorial ↗The comparison using equals() is case-sensitive. To perform a comparison that ignores case differences, call equalsIgnoreCase(). When it compares two strings, it considers A-Z to b
Read tutorial ↗The regionMatches() method compares a specific region inside a string with another specific region in another string. There is an overloaded form that allows you to ignore case in
Read tutorial ↗String defines two routines that are, more or less, specialized forms of regionMatches(). The startsWith() method determines whether a given String begins with a specified string.
Read tutorial ↗It is important to understand that the equals() method and the == operator perform two different operations. As just explained, the equals() method compares the characters inside a
Read tutorial ↗