I am following a Book in this book the code is given i tried to compile it but it shows errors here is the Code-
class TapeDeck {
boolean canRecord = false;
void playTape() {
System.out.println("tape recording");
}
void recording() {
System.out.println("tape recording");
}
}
class TapeDeckTestDrive {
public static void main (String [] args) {
TapeDeck t = new TapeDeck( );
t.canRecord = true;
t.play();
if (t.canRecord == true) {
t.recordTape();
}
}
}
and an error is....
TapeDeck.java:16: error: cannot find symbol
t.play();
^
symbol: method play()
location: variable t of type TapeDeck
TapeDeck.java:19: error: cannot find symbol
t.recordTape();
^
symbol: method recordTape()
location: variable t of type TapeDeck
2 errors