create named class
Can you check my coding@program:
How to create a class named Employee with name and salary. Make a class Manager inherit from Employee with an instance field named department. Supply a method toString() that prints the manager?s name, department and salary. Make another class named Director which inherits from Manager that has an instance field named carAllowanceAmount. Supply the toString() method for Director that prints all of its instance variables. Also, write a program name TestQ3 that instantiates an object of each of these classes and invokes the toString() method of each of these object.
(Note: all instance variables must be assigned with private accessibility and methods with public accessibility)
My coding :
class Employee {
private String name = "Zam Norfaizah Binti Zain Baharin";
private int salary = 2500;
public String toString() {
return "Name : " + name + "\nSalary : " + salary;
}
}
class Manager extends Employee {
private String departName = "College Art and Sciences";
public String toString() {
return super.toString() + "\nDepartment Named : " + departName;
}
}
class Director extends Manager {
private int carAllowanceAmount = 500;
public String toString() {
return "The car allowance amount is : " + carAllowanceAmount;
}
}
public class TestQ3 {
public static void main(String args[]) {
Manager mnger = new Manager();
System.out.println(mnger.toString());
Director dir = new Director();
System.out.println(dir.toString());
}
}
Can you comment and give the reason? what the true coding?
View Answers
Related Tutorials/Questions & Answers:
create named class - Java Beginnerscreate named class Can you check my coding@program:
How to
create a
class named Employee with name and salary. Make a
class Manager inherit from...() that prints the manager?s name, department and salary. Make another
class named Advertisements
to create a java class and methodsto
create a java
class and methods How to
create a java
class without using the library
class to represent linked lists of integers and also provide it with methods that can be used to reverse a list & append two lists.Also
How to create a class in javaHow to
create a
class in java I am a beginner in programming and tried to learn how to do programming in Java. Friends please explain how can I
create a
class in Java
Create Action classCreate Action
Class
An action is an important portion of web application... an action
class you need to extend or import the Action classes or interface... package. The
commonly used action
class is ActionSupport. An example of action
a class named Transactionsa
class named Transactions Write this java code for me:
a
class named Transactions that holds the memo and the amount of a transaction.
Prompt the user for the number of transactions and
create a new Transaction object
ModuleNotFoundError: No module named 'class'ModuleNotFoundError: No module
named '
class' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module
named '
class'
How to remove the ModuleNotFoundError: No module
named '
class'
ModuleNotFoundError: No module named 'class_a'ModuleNotFoundError: No module
named '
class_a' Hi,
My Python... '
class_a'
How to remove the ModuleNotFoundError: No module
named '
class..., ModuleNotFoundError: No
module
named '
class_a' error will be solved
ModuleNotFoundError: No module named 'class'ModuleNotFoundError: No module
named '
class' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module
named '
class'
How to remove the ModuleNotFoundError: No module
named '
class'
ModuleNotFoundError: No module named 'class_a'ModuleNotFoundError: No module
named '
class_a' Hi,
My Python... '
class_a'
How to remove the ModuleNotFoundError: No module
named '
class..., ModuleNotFoundError: No
module
named '
class_a' error will be solved
Design a class named accountDesign a
class named account The
class contains:
§ An int data field
named id for the account (default 0).
§ A double data field
named balance for the account (default 0.0)ADS_TO_REPLACE_1
§ A double data field
named ModuleNotFoundError: No module named 'create'ModuleNotFoundError: No module
named '
create' Hi,
My Python... '
create'
How to remove the ModuleNotFoundError: No module
named '
create'..., ModuleNotFoundError: No
module
named '
create' error will be solved.
Thanks
ModuleNotFoundError: No module named 'create'ModuleNotFoundError: No module
named '
create' Hi,
My Python... '
create'
How to remove the ModuleNotFoundError: No module
named '
create'..., ModuleNotFoundError: No
module
named '
create' error will be solved.
Thanks
create a named screen in linuxcreate a
named screen in linux Hi,
I want to
create a screen... of your guys to tell me the command.
How to
create a
named screen in linux... is an example:
screen -S myapp
Above command will
create screen with the name my
ModuleNotFoundError: No module named 'auto-class'ModuleNotFoundError: No module
named 'auto-
class' Hi,
My Python... 'auto-
class'
How to remove the ModuleNotFoundError: No module
named 'auto...-
class python library, ModuleNotFoundError: No
module
named 'auto-
class'
ModuleNotFoundError: No module named 'case_class'ModuleNotFoundError: No module
named 'case_
class' Hi,
My Python... 'case_
class'
How to remove the ModuleNotFoundError: No module
named 'case..._
class python library, ModuleNotFoundError: No
module
named 'case_
class'
ModuleNotFoundError: No module named 'class-pool'ModuleNotFoundError: No module
named '
class-pool' Hi,
My Python... '
class-pool'
How to remove the ModuleNotFoundError: No module
named '...-pool python library, ModuleNotFoundError: No
module
named '
class-pool'
ModuleNotFoundError: No module named 'class-property'ModuleNotFoundError: No module
named '
class-property' Hi,
My...
named '
class-property'
How to remove the ModuleNotFoundError: No module
named... the installation of
class-property python library, ModuleNotFoundError: No
module
named ModuleNotFoundError: No module named 'class_proxy'ModuleNotFoundError: No module
named '
class_proxy' Hi,
My Python... '
class_proxy'
How to remove the ModuleNotFoundError: No module
named '... of
class_proxy python library, ModuleNotFoundError: No
module
named '
class_proxy
ModuleNotFoundError: No module named 'class-registry'ModuleNotFoundError: No module
named '
class-registry' Hi,
My...
named '
class-registry'
How to remove the ModuleNotFoundError: No module
named... the installation of
class-registry python library, ModuleNotFoundError: No
module
named ModuleNotFoundError: No module named 'class-tools'ModuleNotFoundError: No module
named '
class-tools' Hi,
My Python... '
class-tools'
How to remove the ModuleNotFoundError: No module
named '... of
class-tools python library, ModuleNotFoundError: No
module
named '
class-tools
ModuleNotFoundError: No module named 'class-tools'ModuleNotFoundError: No module
named '
class-tools' Hi,
My Python... '
class-tools'
How to remove the ModuleNotFoundError: No module
named '... of
class-tools python library, ModuleNotFoundError: No
module
named '
class-tools
ModuleNotFoundError: No module named 'class-utils'ModuleNotFoundError: No module
named '
class-utils' Hi,
My Python... '
class-utils'
How to remove the ModuleNotFoundError: No module
named '... of
class-utils python library, ModuleNotFoundError: No
module
named '
class-utils
ModuleNotFoundError: No module named 'class-utils'ModuleNotFoundError: No module
named '
class-utils' Hi,
My Python... '
class-utils'
How to remove the ModuleNotFoundError: No module
named '... of
class-utils python library, ModuleNotFoundError: No
module
named '
class-utils
ModuleNotFoundError: No module named 'db_class'ModuleNotFoundError: No module
named 'db_
class' Hi,
My Python..._
class'
How to remove the ModuleNotFoundError: No module
named 'db_
class... library, ModuleNotFoundError: No
module
named 'db_
class' error
ModuleNotFoundError: No module named 'django-class'ModuleNotFoundError: No module
named 'django-
class' Hi,
My Python... 'django-
class'
How to remove the ModuleNotFoundError: No module
named '... of django-
class python library, ModuleNotFoundError: No
module
named 'django
ModuleNotFoundError: No module named 'django-class'ModuleNotFoundError: No module
named 'django-
class' Hi,
My Python... 'django-
class'
How to remove the ModuleNotFoundError: No module
named '... of django-
class python library, ModuleNotFoundError: No
module
named 'django
ModuleNotFoundError: No module named 'django-class'ModuleNotFoundError: No module
named 'django-
class' Hi,
My Python... 'django-
class'
How to remove the ModuleNotFoundError: No module
named '... of django-
class python library, ModuleNotFoundError: No
module
named 'django
ModuleNotFoundError: No module named 'hz_class'ModuleNotFoundError: No module
named 'hz_
class' Hi,
My Python..._
class'
How to remove the ModuleNotFoundError: No module
named 'hz_
class... library, ModuleNotFoundError: No
module
named 'hz_
class' error
ModuleNotFoundError: No module named 'note_class'ModuleNotFoundError: No module
named 'note_
class' Hi,
My Python... 'note_
class'
How to remove the ModuleNotFoundError: No module
named 'note..._
class python library, ModuleNotFoundError: No
module
named 'note_
class'
ModuleNotFoundError: No module named 'radio-class'ModuleNotFoundError: No module
named 'radio-
class' Hi,
My Python... 'radio-
class'
How to remove the ModuleNotFoundError: No module
named '... of radio-
class python library, ModuleNotFoundError: No
module
named 'radio-
class ModuleNotFoundError: No module named 'scraping-class'ModuleNotFoundError: No module
named 'scraping-
class' Hi,
My...
named 'scraping-
class'
How to remove the ModuleNotFoundError: No module
named... the installation of scraping-
class python library, ModuleNotFoundError: No
module
named ModuleNotFoundError: No module named 'Xymon_Class'ModuleNotFoundError: No module
named 'Xymon_
Class' Hi,
My Python... 'Xymon_
Class'
How to remove the ModuleNotFoundError: No module
named '... of Xymon_
Class python library, ModuleNotFoundError: No
module
named 'Xymon_
Class ModuleNotFoundError: No module named 'auto-class'ModuleNotFoundError: No module
named 'auto-
class' Hi,
My Python... 'auto-
class'
How to remove the ModuleNotFoundError: No module
named 'auto...-
class python library, ModuleNotFoundError: No
module
named 'auto-
class'
ModuleNotFoundError: No module named 'case_class'ModuleNotFoundError: No module
named 'case_
class' Hi,
My Python... 'case_
class'
How to remove the ModuleNotFoundError: No module
named 'case..._
class python library, ModuleNotFoundError: No
module
named 'case_
class'
ModuleNotFoundError: No module named 'Check-class'ModuleNotFoundError: No module
named 'Check-
class' Hi,
My Python... 'Check-
class'
How to remove the ModuleNotFoundError: No module
named '... of Check-
class python library, ModuleNotFoundError: No
module
named 'Check-
class ModuleNotFoundError: No module named 'class-cli'ModuleNotFoundError: No module
named '
class-cli' Hi,
My Python... '
class-cli'
How to remove the ModuleNotFoundError: No module
named '
class... python library, ModuleNotFoundError: No
module
named '
class-cli' error
ModuleNotFoundError: No module named 'class-doc'ModuleNotFoundError: No module
named '
class-doc' Hi,
My Python... '
class-doc'
How to remove the ModuleNotFoundError: No module
named '
class... python library, ModuleNotFoundError: No
module
named '
class-doc' error
ModuleNotFoundError: No module named 'class-pool'ModuleNotFoundError: No module
named '
class-pool' Hi,
My Python... '
class-pool'
How to remove the ModuleNotFoundError: No module
named '...-pool python library, ModuleNotFoundError: No
module
named '
class-pool'
ModuleNotFoundError: No module named 'class-property'ModuleNotFoundError: No module
named '
class-property' Hi,
My...
named '
class-property'
How to remove the ModuleNotFoundError: No module
named... the installation of
class-property python library, ModuleNotFoundError: No
module
named ModuleNotFoundError: No module named 'class_proxy'ModuleNotFoundError: No module
named '
class_proxy' Hi,
My Python... '
class_proxy'
How to remove the ModuleNotFoundError: No module
named '... of
class_proxy python library, ModuleNotFoundError: No
module
named '
class_proxy