Casting must be done when converting an object from a "wider" or "parent" object to a "narrower" or "child" object. As an example, you do not need to cast from a byte to an int, but you must cast from an int to a byte; the compiler requires the cast so that the developer confirms that they are okay with a possible loss of data. Similarly, given the classes Vehicle, Car, and Truck, where Car and Truck are children of Vehicle, no cast is required to convert either a Car or Truck to a Vehicle, but the language requires a cast to convert a Vehicle to a Car or Truck.
In this case, if the Vehicle is cast to a Car, but is actually a Truck, the cast will fail and a runtime exception will be thrown. By casting a Vehicle to a Car, the developer acknowledges that they already know the Vehicle is a Car, and the compiler honors that arrangement. The Virtual Machine expects the Vehicle to be a Car, but if it is actually a Truck, the exception is thrown.
The objective of casting is to allow conversion between semi-compatible types of data where some loss of data may occur, but the developer has logically proven that the loss will never occur or is acceptable. You cannot cast a Car to an int, for example, because there is no possibility that a Car will ever be an int. The compiler will advise you of this fact and refuse to compile the code.
Type casting is used to convert from one datatype to the other
with help of type casting it is possible
Type casting exists to allow the use of base class or base interface reference but yet if you know that the object in hand is aspecific derived class, you can typecast and access methods available only in the derived class.
Java does not support Pointers and hence you cannot use it in Java.
It is possible in JDK 1.5 and above. In JDK 1.4, you also cast the Float value into float value by using casting. For exampe in JDK 1.5, its possible float f = 12; Float ff = f; but in JDK 1.4, you will use casting i.e float f = 12; Float ff = (float)f;
Java is exclusive to surfing the web. Some web sites use Java to embed videos, others use Java for advertisements.
No
Java does not have pointers
Java 7 is the most current version of Java. Many movies and games use Java.
You can use Head First Java or Java Complete Reference to learn Java.
Not usually. There are numerous languages out there with similar functionality. The only time you must use Java is if your employer or client demands that a project be done in Java, or a particular platform requires the use of Java, such as Android OS.
RuneScape bots use Java. Use a Java Binary Code.