JavaLanguage Section Index | Page 33
Pretty much just like any other cast: myArrayRef = (MyArrayType) objectRef; For more information, check out Section 5.5 of the Java Language Specification.
The national language of Indonesia is Bahasa Indonesia. The largest ethnic group on the island is Javanese, which has their own language dialect.more
It depends on the type of the arguments... For integer arguments, the single ampersand ("&")is the "bit-wise AND" operator. The double ampersand ("&&") is not defined for anything but two boolean...more
The island of Java is in Indonesia and contains the country's capital, Jakarta.
Since strings are character based, you should convert the String to a Reader-type stream, not an InputStream: Reader reader = new StringReader(theString); Note that the StringBufferInputStream d...more
Place the @deprecated tag in the javadoc for the class or method, with a reason why you are deprecting the class or method: /** * @deprecated As of version 3.5, replaced by * fooBar * @see #f...more
As classes evolve, their API change. To signal to developers that they are using an antiquated feature, class designers can flag classes or methods as deprecated. When used, the compiler will warn...more
Support for audio recording is not part of the core Java libraries. Instead, you need to use the Java Media Framework (http://java.sun.com/products/java-media/jmf).more
In Java, Strings are immutable. Since the string cannot be modified in place, the replace() method returns a new String constructed from a modified copy of the original String's value.more
The constant value 3.5 is recognized by the compiler to be a double rather than a float. You must place an f after the 3.5 for it to be recognized as a floating point constant value: float f = 3....more
The signature of a method is the combination of the method's name along with the number and types of the parameters (and their order).
You can wait for a thread to finish by calling its join() method. For instance, in the following code, the current thread will wait until thread2 finishes before printing Done. thread2.start(); /...more
In short, no. Once a thread is stopped, it cannot be restarted. Keep in mind though that the use of the stop() method of Thread is deprecated and should be avoided.
Overriding methods cannot change the signature of the overridden method. All exceptions are included in the signature of the method except for RunTimeException and it's subclasses. So, the only e...more
Using the Java Reflection API permits you to dynamically invoke methods from string names at a significant performance penalty. To find the method to invoke, you would create an array of argument...more