Level 7 Objects "new"


#1

I kept getting the same error message for a block of code and when i got the correct code I noticed that the word "new" must precede the dog object and instance (3). Why does the word "new" impact the code running properly? Below is the correct way to do it according to the lesson:

public static void main(String[] args) {

Dog spike = new Dog(3);

}


#2

This is because you are creating a new instance of the class Dog.
whenever you create a new instance of a class you will need the word "new".

Thanks
Rexy