0

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 by Valiantangel: adjustment

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by JamesCherrill
0

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.

0

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 by happygeek: fixed formatting

0

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 by JamesCherrill: typos

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.