Constructor overloading in java


Q1. Write down a superclass Worker and subclasses HourlyWorker and SalariedWorker. Every worker consists of a name and a salary rate. Write down a method computePay(int hrs) which computes the weekly pay for every worker. The hourly worker gets paid the hourly wage for the actual number of hrs worked, if hours are at most 40. If the hourly worker worked greater than 40 hrs, the excess is paid at time and a half. The salaried worker gets paid the hourly wage for 40 hrs, no matter what the actual number of hrs is. Write down a static method which uses polymorphism to calculate the pay of any worker. Supply a test program which tests these classes and methods.

Q2. How inter thread communication is completed in Java? Write down a java program to make multithreads with various priorities.

Q3. Illustrate the significance of exception handling method in Java? Define and differentiate checked and unchecked exceptions.

Q4. What do you mean by constructor overloading in java? Describe with an illustration. List all the special properties of the constructors.

Q5. Write brief notes on the given (Any four) giving appropriate illustrations:

a) Java API packages.
b) AWT controls.
c) Adapter classes.
d) Servlets.
e) Event Listener Interfaces.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Constructor overloading in java
Reference No:- TGS010681

Expected delivery within 24 Hours