Making an object type from an object? Java
Hello fellow coders! I was wondering whether it is possible to make an object type from an object? For example, I have a class called 'Animal' and using that I want to make an object dog. However since there are many types of dogs, I want to be able to say something like DogBreed1, DogBreed2, DogBreed3. so that way I can set the attributes of each individual dogbreed from that set rather than affect all of my dogs. Sorry if this sounds confusing. I'm just a new experimental guy trying to understand. public class Animal { //color of Animal int age; String origin; String color; //let's make some animals from our Animal class Animal dog = new Animal(); Animal cat = new Animal(); Animal bear = new Animal(); /*let's make different breeds types from our dog object so that later we can apply changes to all of the objects of that breed rather than all of our dog objects./* dog dogbreed1 = new dog(); }