What's wrong in my code 12/13 oop


#1


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();

    

	}

}

	}

}

Help?12/13?
#2

@arrayninja97428,
With a google search
== the Book ==
java class definition site:oracle.com
you will find articles... please read them to understand the build and usage of classes in JAVA.


#3

I'm stuck here too lol


#4

I'm also stuck here.

...on an somewhat related side note, I've perused various forum answers here to get insight, etc., and many of the threads seem to have a similar type of answer: "Go read stuff on Google/Youtube." So, the button that says "get help in the forums" while doing tutorials should be changed to "if you don't know what you're doing, get the ■■■■ out of this site and go to other sites until you know, then come back." Good job community! Way to make the coding world a better place!


#5

I was also facing the same issue. The Dog.java code was fine. The Animal class was also created correctly. I have been trying to sort out the issue for 4 days now. And finally I got the answer. There is another tab by name Animal.java next to Dog.java tab. If we copy paste the code from Animal.java code in Dog.Java coding area, and Run the code, the Next button gets enabled.

All the best.


#6

Hi,

After searching older discussions I have found this reply.

I was quite surprised as I used the code sourced from the “Get Code” option received during the step 10 or 11.

Hope that helps,
Łukasz


#7