What is casting, when do we need it?
Answers
Explanation:
well, you need type casting to get access to fields and methods declared on target type or class. You can not access them with any other type. Let's see a simple example of type casting in Java with two classes Base and Derived which shares same type hierarchy.
Answer:
Casting is a manufacturing process in which a liquid material is usually poured into a mold, which contains a hollow cavity of the desired shape, and then allowed to solidify. The solidified part is also known as a casting, which is ejected or broken out of the mold to complete the process
Explanation:
Casting is a manufacturing process in which a liquid material is usually poured into a mold, which contains a hollow cavity of the desired shape, and then allowed to solidify. The solidified part is also known as a casting, which is ejected or broken out of the mold to complete the process