- Home /
This question was
closed Dec 11, 2013 at 06:07 AM by
fafase for the following reason:
Question is off-topic or not relevant
Question by
jvt619 · Dec 11, 2013 at 06:04 AM ·
instantiateparentchildclass
Basic question about Parent-Child and Instantiation
public class Child : Parent{}
VS
Parent parent = new Parent();
what's the difference between the two?
Comment
Answer by fafase · Dec 11, 2013 at 06:07 AM
This is simply not the same thing.
The first one is a class declaration where you declare a class to be named Child and inherits from Parent.
The second is an object instantiation of type Parent.
If you need more info you need to read the OOP part of a programming book. This would be way too long to explain here and not related to Unity.