Question
JAVA LANGUAGE Does anyone understand this error? when I erase it, more errors show up. I use drjava. Error: Syntax error on token ), {
JAVA LANGUAGE
Does anyone understand this error? when I erase it, more errors show up. I use drjava.
Error: Syntax error on token ")", { expected after this token
class HospitalEmployee{ private String empName; private int empNo; private static void main(String args[]) }
public HospitalEmployee(String empName, int empNo) { this.empName = empName; this.empNo = empNo; }
public String getEmpName() { return empName; }
public int getEmpNo() { return empNo; } } class Employee extends HospitalEmployee{
public Employee(String empName, int empNo) { super(empName, empNo); }
public String toString(){ return this.getEmpName()+" works for the hospital"; }
}
class Administrator extends HospitalEmployee{ private String deptName; public Administrator(String empName, int empNo,String deptName) { super(empName, empNo); this.deptName=deptName; }
public String getDeptName() { return deptName; }
public void setDeptName(String deptName) { this.deptName = deptName; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started