12/13 the checkStatus


everything been going smooth till i got stuck at the "checkStatus" method calling
here is my code

class Dog extends Animal {
int age;
public void Dog(int dogsAge)
dogsAge = age;

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(2)
int spikeAge =

it keeps saying "Did you call the checkStatus method inside of main?"


Constructor can't return anything, even void (the object itself is the implicit return).

public void Dog(int dogsAge)
dogsAge = age;

should be like

public Dog(int dogsAge) {
  	age = dogsAge;

Dog spike = new dog(2) //wrong

creating a Dog object using Dog constructor should be like

Dog spike = new Dog(2); // and need ; after this


thnx man , it worked ,,appreciate it .


I don't understand what I am doing wrong. I've read the posts that have been put in, tried putting in what you said where it said it should go, and I'm still wrong. Why?


if you have any problem at this lesson then you should create a new topic

1.click on this link
2.click on New Topic
3.read the forum carefully. post your code and tell us your problem
4.click on Create Topic


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