0% found this document useful (0 votes)
15 views1 page

Name Age Designation: Public Class

The document defines an Employee class with name, age, and designation fields and constructor and methods to set and print employee details.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Name Age Designation: Public Class

The document defines an Employee class with name, age, and designation fields and constructor and methods to set and print employee details.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

public class Employee {

String name;
int age;
String designation;

public Employee (String name) {


this.name = name;
}
public void empAge(int empAge) {
age = empAge;
}
public void empDesignation(String empDesig) {
designation = empDesig;
}
public void printEmployee() {
System.out.println("Name:"+ name );
System.out.println("Age:" + age );
System.out.println("Designation:" + designation );
}
}

You might also like