11/13 second Excercise

class Dog {
  int age;

	public Dog(int dogsAge) {
  	age = dogsAge;
  public void bark() {
  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);
    int tires = spike.getAge();



Did you set the `spikeAge` variable equal to 
the result of calling the `getAge` method? Use the example to 
help you. << This ist he error message. Nothing help.
I hope you can help me.


Inside of main, set an int variable spikeAge to the value returned by spike.getAge();

so instead of this

int tires = spike.getAge();

your code should be like

int spikeAge = spike.getAge();
1 Like

Thank you it works !

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