how to fix this error?

0 votes
asked Nov 7 by (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 by (1,710 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 by (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.
...