Prev Next

Java / Casting

1. Is Dynamic casting available in Java?
for e.g. typeVariable = (Dynamic-Type) list.get(0);

No.not possible.

Read full answer

2. What is type casting in Java?

The conversion of data from one data type to another data type is termed as type casting. Type casting refers to changing the type of the data....

Read full answer

3. Explain the different types of casting in Java.

There are 2 types. Primitive casting refers to the casting between primitive data types.

Read full answer

4. What is auto widening and explicit narrowing in Java?

The data is implicitly casted from small sized primitive type to big sized primitive type. This is called auto-widening....

Read full answer

5. What is auto-up casting and explicit down casting in Java?

An object of sub class type can be automatically casted to super class type. This is called auto-up casting.

Read full answer

«
»

Comments & Discussions