I don't understand 7/11 exercise :(


#1

i dont understand whats this here
class Car {

int modelYear;

public Car(int year) {

   >  modelYear = year;
}

public static void main(String[] args){

    Car myFastCar = new Car(2007);

}

}


#2

class Dog {


int age;

	public Dog(int dogsAge) {
    age = dogsAge;
  

	}
  public static void main(String[] args) {
    
    Dog spike = new Dog(100);

}

}

So i did this and got passed but its like passing my school exams i still don't know how that happened,


#3

I have everything you have, but my dog is 5 and not 100. It won't let me passed it. It keeps asking if I have created a dog constructor using the dog object. It tells me to be sure to indicate an integer parameter. I'm stuck.


#4

i am no expert still figuring out but make sure ur D is uppercase ,


#5

I reset the problem,and typed in exactly what I had before, and it worked.
Must be a glitch.

Thanks


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.