Computer Science, asked by tanushharshith1927, 4 months ago

What is casting, when do we need it?

Answers

Answered by SHIVAMRAIKWAR
2

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.

Answered by charu2013b
1

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

Similar questions