Please inform me on my mistake? no errors but cant pass the objective


#1

https://www.codecademy.com/courses/learn-java/lessons/object-oriented-programming/exercises/objects?action=lesson_resume&link_content_target=interstitial_lesson

i have no errors in my code, this is my issue

the commented block of code is my written code, the non commented is the code it fills in when i get given the option, the only difference i am able to find is that i have comments but i continue to fail objective




class Dog {
  
  int age;

	public Dog(int dogsAge) {
    
  	age = dogsAge;
    
  }

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

	}

}

/* class Dog {
  
  //using an instance variable for age
  int age;
	
  //class constructor
	public Dog(int dogsAge) {
    
    age = dogsAge;
  
  }


	public static void main(String[] args) {
    
    //creating the dog object
    Dog spike = new Dog(5);

	}

}*/



#2

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