Kevin Althaus wrote:Yes, it's starting to make more sense.
I'm working thru some tutorials on this and it's all coming together.
dog1, dog2, dog3 are the objects created from the class Dog. The methods are used to construct the object. Would it be safe to say that the class is just a container for the methods?
Thank you for taking the time answer this.
yes they are all objects of class Dog
the "method" used to construct them isn't actually a method, it is called a constructor, it looks very similar to a method yes but notice there is no return type.
but in short yes the "method" for creating objects of class is called a constructor, and sometimes if you do not see one in code or you dont want to pass values in and let it take the defaults then there is an implicit default constructor, it is provided for you by the compiler.
for example say I left the constructor out, then i just created the objects by doing the following:
then that would be using the default constructor. if you add no constructors of your own then the compiler automatically adds the default constructor in for you.