Help?12/13?


#1

Continuing the discussion from What's wrong in my code 12/13 oop:

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

[quote=“arrayninja97428, post:1, topic:55592, full:true”]


hey admins , developpers and members
please tell me what’s wrong with my code


 int age;

	public Dog(int dogsAge) {
    
  	age = dogsAge;
    
  }
  
  public void bark() {
		
    System.out.println("Woof!");
    
	}
	
  public void run(int feet) {
    
    System.out.println("Your dog ran " + feet + " feet!");

	}
  
  public int getAge() {

    return age;
    
	}
  
	public static void main(String[] args) {
    
    Dog spike = new Dog(5);
    spike.bark();
    spike.run(40);
    int spikeAge = spike.getAge();
    System.out.println(spikeAge);
    class Dog extends Animal {
  
  int age;

	public Dog(int dogsAge) {
    
  	age = dogsAge;
    
    
  }
  
  public void bark() {
		
    System.out.println("Woof!");
    
    
	}
  public void run(int feet) {
    {
    
    System.out.println("Your dog ran " + feet + " feet!");

}
  public int getAge() {
    
    return age;
    
    }
    

	public static void main(String[] args) {
    
    Dog spike = new Dog(5);
   
    spike.bark();
    feet.run(5);
    spike.run(2);
    int spikeAge = spike.getAge();
    System.out.println(spikeAge);
    spike.checkStatus();

    

	}

}

	}

}

[/quote]



Replace this line with your code. 



#2

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