When you create a class you are essentially creating a prototype...a template...for future copies of the prototype which are called objects. Similar to the Oasis of the Seas cruise ship. The Oasis is the flagship and all other ships made like her are referred to as Oasis class ships....Ohio class submarines...etc. Each is a duplicate of the first including all of the attributes and methods. Each object has 'inherited' the details of the parent class. Am I right?
To create this class I do this...
public class Dog
{
attribute
attribute
method
}
to create a object of the class which carries with it all of the class 'stuff' I do this...
Dog Canine=new Dog();
which now allows me to refer to the 'stuff' of the class
canine.attribute
canine.method
So here is the question...
If I have created an instance of the class with my object what is the purpose of the inheritance operator...
public class Canine : Dog
What does this do that the first example doesnt?
tex
To create this class I do this...
public class Dog
{
attribute
attribute
method
}
to create a object of the class which carries with it all of the class 'stuff' I do this...
Dog Canine=new Dog();
which now allows me to refer to the 'stuff' of the class
canine.attribute
canine.method
So here is the question...
If I have created an instance of the class with my object what is the purpose of the inheritance operator...
public class Canine : Dog
What does this do that the first example doesnt?
tex