answersLogoWhite

0

What is casting and its type?

Updated: 8/21/2019
User Avatar

Wiki User

10y ago

Best Answer

Simply stated, casting allows you to change the type (class) of an object.

Technically, the object itself does not change type, but your reference is changed. For example, lets suppose you have the class "Animal" with subclasses "Cat" and "Dog". If you have a reference (variable) declared to be type "Animal" and you store and object of type "Dog" in it, you will not be able to call any methods from the "Dog" class which the "Animal" class does not have. You would first need to cast your reference to "Dog" so that you can utilize those methods.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is casting and its type?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What type of surface defects on the casting?

your a Dylan


Is the process of casting actors that have a physical appearance and personality similar to a particular character in a play?

Type-casting.


What is converting data types?

Type cast


Top gates are provided in which type of casting like as shallow casting or simple or complex or none?

ans is none because top gate are used in very large casting due to erosion occur in this casting


What is type conversion?

Type conversion or type casting is the method of changing the entity of datatype to another.


What is skeleton pattern used in casting process?

these consist of a single wood frame outlining the shape of of the casting .this type of pattern is used for large casting ,required in small number.


What type of castings are used to form glass?

Investment casting


Which metal working process was used to make type?

casting


What type of gm transmission is casting number 24238455?

6L80e


Is The casting number of 14093638 a lt1?

What type of engine is 14093638


What are the classifications of continuous casting machines?

Continuous casting machine can be classified according to a variety of forms. If according to the structure appearance can be divided into vertical continuous casting machine, vertical bending continuous casting machine, with straight section arc continuous casting machine, arc continuous casting machine, multi-radius oval continuous casting machine and horizontal continuous casting machine. With the development of continuous casting technology, and carried out the wheel type continuous casting machine, especially the thin slab continuous casting machine research.


How do you change a float into a double using java?

with help of type casting it is possible