hi,

i read through a few website ,gone through a few examplebut i am still getting 01 error in my code?
Error message:
goldFish.java:11: error: cannot find symbol
void perform(){System.out.printIn(this.action);
^
symbol: method printIn(String)
location: variable out of type PrintStream
1 error

abstract class Pet {

abstract void perform();

}

class GoldFish extends Pet{
String action="Blowing bubbles";
GoldFish(String action){
this.action = action ;
}
void perform(){System.out.printIn(this.action);
}

}

Code blocks are created by indenting at least 4 spaces
... and can span multiple lines

Edited 4 Years Ago by Valiantangel: adjustment

This new forum formatting of posts is awful.
The code you posted is very confusing with the way it comes and goes out of formatting.

Where was the ^ in the original error message?

You should not need a this. in the println() statement.

After deleting this. from print(), Got the following error.

goldFish.java:11: error: cannot find symbol
    void perform(){System.out.printIn(action);
                             ^
  symbol:   method printIn(String)
  location: variable out of type PrintStream
1 error

Edited 3 Years Ago by happygeek: fixed formatting

void perform(){System.out.printIn(this.action);

Yet another problem with code formatting - which hides the fact that you have typed printIn instead of println. Confused? I'm not suprised. Your version has an upper-case I for India where it should have a lower-case l for Lima.

Edited 4 Years Ago by JamesCherrill: typos

This article has been dead for over six months. Start a new discussion instead.