Write a program in java to a class called Employee which
is
having the following instance variables.
name(string type)
age(int type)
designation(string type)
salary(double type)
The class Employee must have a parameterized constructor
having
only name as the argument and initializes the name variable.
Proceed with same class....
write a method called empAge to change the state of age
variable after passing an integer value.
write a method called empDesignation to change the state of
variable designation after passing a string.
write a method called empSalary to change the state of
salary
variable after passing a double type value.
After writing the main method create an instance of the
class
Employee and enter the following details and check your
construction by printing it.
said
21
programmer
800.0
Recommended Answers
Jump to PostOkay. Finished.
Jump to PostIn case you haven't guessed it yet, we are not a homework and are not going to do it for you. Now stop flooding the forum with BS and get to work and maybe you'll actually be able to finishe one or two of them.
Jump to PostOkay? So what compiler messages do you get? What errors do you get when running it? How does the expected output differ from the actual output?
As a few points:
Where is the parameterised constructor?
Where are all of the "emp" methods?And, let me guess, you …
Jump to PostAlso, in response to your PMs. Doing your homework for you is not helping you. You would only be that much more lost tomorrow than you are today when you get an assignment that builds on what you were suppossed to have learned today (which you learn nothing if someone …
All 14 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.