Hello everyone, first of all I would like to say that I'm new to java and I'm getting this error while trying to compile a program from a book that I am using to learn the language.
Ok so the program is very basic just two classes here is my code:
class Dog {
int size;
String breed;
String name;
void bark() {
System.out.println("Ruff! Ruff");
}
}
and...
class DogTestDrive {
public static void main(String[] args) {
Dog d = new Dog();
d.size = 40;
d.bark();
}
}
Out of those two classes the Dog class compiles fine but when I try to compile the second class(DogTestDrive), I'm getting this error:
c:\users\owner\desktop\DogTestDrive.java:3: cannot find symbol
symbol : class Dog
location: class DogTestDrive
Dog d = new Dog();
^
2 errors
Can anyone tell me what I'm doing wrong? This is the second time I've gotten this type of error even though I copy the code word for word. Thanks in advance.