- #1
- 6,375
- 980
When I am creating an object via
car audi
audi=new car()
what does the first line actually do? In non object oriented languages, some declaration like
int mynumber
to reserve a certain kind of bytes.
But how does the compiler know what to reserve for the variable audi knowing it is of type car?
If it already knows it belongs to the class car, then why the second line?
car audi
audi=new car()
what does the first line actually do? In non object oriented languages, some declaration like
int mynumber
to reserve a certain kind of bytes.
But how does the compiler know what to reserve for the variable audi knowing it is of type car?
If it already knows it belongs to the class car, then why the second line?