Generation

generate functionTue, 13 Jun 2023

using java create a new Class called Employee and have these attributes ( id, name, age, position, salary ) also, create a new instance from Employee class to print the below result id name age position Salary 123 Jo 25 QE 300 456 smith 30 Dev 400

class Employee{ private int id; private String name; private String position; private int age; private int salary; public Employee() {}// used to create an instance public void setId(int id){ this.id = id; } public int getId(){ return id; } public void setName(String name){ this.name = name; } public String getName(){ return name; } public void setPosition(String position){ this.position = position; } public String getPosition(){ return position; } public void setAge(int age){ this.age = age; } public int getAge(){ return age; } public void setSalary(int salary){ this.salary = salary; } public int getSalary(){ return salary; } } public class Question8{ public static void main(String[] args){ Employee emp1 = new Employee(1, "Jo", "QE", 25, 300); Employee emp2

Questions about programming?Chat with your personal AI assistant