Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Keep getting this error help.

–3 votes
asked Oct 2, 2019 by to_Bewilder (100 points)
edited Oct 2, 2019 by to_Bewilder

Main.java:14: 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 https://onlinegdb.com/HkoGVBM_r

3 Answers

+1 vote
answered Oct 2, 2019 by Admin (5,100 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 " filename.java".

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.
...