The code I'm trying to compile is:
class Drumkit {
boolean topHat = true;
boolean snare = true;
void playSnare() {
System.out.println("bang bang ba-bang");
}
void playTopHat() {
System.out.println("ding ding da-ding");
}
}
class DrumKitTestDrive {
public static void main(String[] args) {
Drumkit d = new DrumKit();
d.playSnare();
d.playTopHat();
d.snare = false;
if (d.snare == true) {
d.playSnare();
}
}
}
But the output is:
C:\JavaTests>javac DrumKitTestDrive.java
DrumKitTestDrive.java:16: error: cannot find symbol
Drumkit d = new DrumKit();
^
symbol: class DrumKit
location: class DrumKitTestDrive
1 error
I don't understand why is it wrong? Excuse me if it is a dumb question, but I'm learning and I think the code is alright. Thank you.