
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;
}

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 3 images

- 3- What is the output of the following program? Why?public class Student {public String getDepartment() {return "general";}public String getStudInfo() {return this.getDepartment();}}public class CSStudent extends Student {public String getDepartment() {return "CS";}}public class Main{public static void main(String[]args){Student s1 = new CSStudent();s1.getStudInfo();}}arrow_forwardFix the code below so that there is a function that calculate the height of the triangle. package recursion; import javax.swing.*;import java.awt.*; /** * Draw a Sierpinski Triangle of a given order on a JPanel. * * */public class SierpinskiPanel extends JPanel { private static final int WIDTH = 810; private static final int HEIGHT = 830; private int order; /** * Construct a new SierpinskiPanel. */ public SierpinskiPanel(int order) { this.order = order; this.setMinimumSize(new Dimension(WIDTH, HEIGHT)); this.setMaximumSize(new Dimension(WIDTH, HEIGHT)); this.setPreferredSize(new Dimension(WIDTH, HEIGHT)); } public static double height(double size) { double h = (size * Math.sqrt(3)) / 2.0; return h; } /** * Draw an inverted triangle at the specified location on this JPanel. * * @param x the x coordinate of the upper left corner of the triangle * @param y the y…arrow_forwardConvert uml to java code with main methodarrow_forward
- PROBLEM STATEMENT: Return the String "odd" if the input is odd otherwisereturn "even". public class CheckForEven{public static String solution(int number){// ↓↓↓↓ your code goes here ↓↓↓↓return null;}} please get help with this Java Questionarrow_forwardTalking: Heba Abde QUESTION 1: Implement class myTime, this class should: 1) Encapsulate information about the hours (integer), minutes (integer), seconds (integer), AM PM (String) 2) Forbid invalid times, where the following criteria should be considered: - hours are in the range [1 – 12], default is 12. - minutes are in the range [0 – 59], default is 0. - seconds are in the range [0-59], default is 0. - AM PM can only be either “AM" or "PM", default is "AM" If any forbidden value entered, you should set the value to default value. 3) Two different constructors (default and parameterized) 4) A print function that will print the time as (hours : minutes : seconds PM/AM) Example: 02:45:30 PM 6) implement function ticktack, which adds one to the seconds, notice that if seconds is 59 and you add one, it should become 0 and the minutes should be incremented by one, also, if after incrementing minutes by one it becomes 60, it should be set to 0 and hours must be incremented by 1, if after…arrow_forwardWhats the output?arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





