Answer Posted / vijayakumar chinnasamy
Casting means converting values from one data type to
other data type.For example to convert the int values to
float type vlaues.
Types of casting:
1. Downcasting -source is larger than destination type
2. upcasting - Source is smaller than destination type.
casting can be applicable to both primitive type and Object
type.
primitive type - convert numeral to floating point and vice
versa.
Object type - converting from subclass to super class or
vice versa.
superClassObj = subClassObj;
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
How to retrieve data from database in java using arraylist?
What is difference between static and final?
What is the importance of hashcode() and equals() methods?
Is class forname reflection?
What is the length of a string?
What is the difference between a constructor and a method?
What is appletviewer?
How do you add an arraylist to an array in java?
What is hashing in java?
What is close method? How it's different from Finalize & Dispose?
How much is a java license?
What one should take care of, while serializing the object?
List the different types of classloaders in java.
What is passing parameters in java?
Can a class have 2 constructors?