Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions