So, I'm trying to understand some concepts here.
1) The general "syntax" (if you will) of creating a new object. For example, which of the following is "correct" (I know there's more than one way to instantiate an object):
//1) ChildClass obj = new ParentClass();
//2) ParentClass obj = new ChildClass();
I know that the following two are "legal," but I can't understand the difference between instantiating an object when it comes to Child/Parent classes
(I already know that these two are okay):
ChildClass obj = new ChildClass();
ParentClass obj = new ParentClass();
2) Basically, what I'm trying to ask is "Which ClassName refers to the class that the object is instantiated from/on (wording? sorry...), and which ClassName does the object belong to?"
My apologies if this doesn't really make sense. I tried wording it the best I can.
(Some background: I am currently taking the first "course" of Object-Oriented Java)