Hi everyone...

Class1 myobject = new Class1();

Am I right in saying that "myobject" holds a copy of all the members in class1?

Also say for instance I have..

Class1 myobject = new Program(); //using the common names of classes...

Can anyone explain or point me to a good site that explains this??

thanks very much...

Recommended Answers

All 2 Replies

Momerath is right. your "myobject" is only a reference to in instance of a class "Class1" some info here.

Your 2nd example is called inheritance and polymosfism. You create one base class, and derived class(es) from it. Take a look at here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.