Https://www.codecademy.com/courses/learn-java/lessons/object-oriented-programming/exercises/methods-2


#1



class Dog {
  
  int age;

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

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

	}

}

Hi i am trying to run the java method || step..but is showing error.
I checked other discussion of the same problem..I tried to resolve it to do step by step also.. but still the same issue..
can some please help me


#2

  System.out.println("Your dog ran " + feet + "feet!");
    
  }

you need a space between feet and feet!


#3

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