Given the following definitions: public abstract class Manager extends Employee {...} public class Executive extends Manager { ... } What, if anything, is wrong with the following code? public class hrSystem { } public void payRaise () { } Manager m = new Manager (); O Compiler error because there is no Manager constructor. Compiler error because Manager is abstract so an instance cannot be created. No problem. The code will compile without any errors. O Compiles fine but will generate a run-time error unless an Employee object is created first

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.1: Classes
Problem 1E
icon
Related questions
Question
Given the following definitions:
public abstract class Manager extends Employee {...}
public class Executive extends Manager { ... }
What, if anything, is wrong with the following code?
public class hrSystem {
}
public void payRaise () {
}
Manager m = new Manager();
O Compiler error because there is no Manager constructor.
Compiler error because Manager is abstract so an instance cannot be created.
No problem. The code will compile without any errors.
O Compiles fine but will generate a run-time error unless an Employee object is created first.
Transcribed Image Text:Given the following definitions: public abstract class Manager extends Employee {...} public class Executive extends Manager { ... } What, if anything, is wrong with the following code? public class hrSystem { } public void payRaise () { } Manager m = new Manager(); O Compiler error because there is no Manager constructor. Compiler error because Manager is abstract so an instance cannot be created. No problem. The code will compile without any errors. O Compiles fine but will generate a run-time error unless an Employee object is created first.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage