Keep getting this error help.

–3 votes
asked Oct 2, 2019 by to_Bewilder (100 points)
edited Oct 2, 2019 by to_Bewilder error: cannot find symbol
        Dog dogger = new Dog();
  symbol:   class Dog
  location: class Main

Dog is just another class but I keep getting this error. But if I try to put the Dog class in the same file, I get an error too. 

Here is the link

3 Answers

+1 vote
answered Oct 2, 2019 by Admin (4,340 points)
Can you please share code by "Share" button?
0 votes
answered Oct 3, 2019 by anonymous

Hello, i just used your code try saving the files as "".

when i did it that fixed your issue for me.

also when validating the choice in the if statement use the .equals() method instead of "==", if you use the "==" method for strings as Strings are objects and not primitives it compares the reference address instead of the value in other words it will always say "that is an improper response".

0 votes
answered Oct 5, 2019 by anonymous
The error you are getting is because the compiler is not able to find the reference to 'Dog' and 'Monkey' class.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.