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 transient variable is different from volatile variable?
What are the important features of Java 9 release?
Difference between operator overloading and function overloading
What package is math in java?
What is object in java?
Why char array is preferred over string for storing password?
What does business logic mean?
What happens when I use / and % with a negative numerator?
what is encapsulation in java? Explain
Why is static used?
What is ascii format?
What is regex used for?
How to sort a collection of custom Objects in Java?
What is the use of default method in interface in java? Explain
Implement two stacks using a single array.