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.

how to fix this error?

0 votes
asked Nov 7, 2019 by Ankith Shetty (120 points)
Main.java:12: error: class Receptionist is public, should be declared in a file named Receptionist.java
public class Receptionist extends javax.swing.JFrame {
       ^
Main.java:7: error: package Receptionists does not exist
import Receptionists.ReceptionistActivity;
                    ^
Main.java:115: error: cannot find symbol
        Hospital hospital = new Hospital();
        ^
  symbol:   class Hospital
  location: class Receptionist
Main.java:115: error: cannot find symbol
        Hospital hospital = new Hospital();
                                ^
  symbol:   class Hospital
  location: class Receptionist
Main.java:121: error: cannot find symbol
        connection = Connector.ConnectDb();
                     ^
  symbol:   variable Connector
  location: class Receptionist
Main.java:130: error: cannot find symbol
                ReceptionistActivity rActivity = new ReceptionistActivity();
                ^
  symbol:   class ReceptionistActivity
  location: class Receptionist
Main.java:130: error: cannot find symbol
                ReceptionistActivity rActivity = new ReceptionistActivity();
                                                     ^
  symbol:   class ReceptionistActivity
  location: class Receptionist
Main.java:133: error: cannot find symbol
                ReceptionistActivity.username = username;
                ^
  symbol:   variable ReceptionistActivity
  location: class Receptionist

2 Answers

0 votes
answered Nov 8, 2019 by gameforcer (2,990 points)
I'm no java expert but I assume you didn't import files containing these classes into your main file. If a program can't find some symbol then it means it cannot see it - sometimes it's because the name used doesn't match up 100% and sometimes it's because of some missed import.
0 votes
answered Nov 10, 2019 by Drilleba Joshua (290 points)
it maight be that the functions or the symbol that you have used were not declared or in the standard library.
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.
...