class Employee
{
int empID,DeptID,Salary;
String empName,BloodGroup;
void setEmpDetails()
{
empID=Integer.parseInt(System.console().readLine("Enter the empID="));
empName=System.console().readLine("Enter the empname=");
DeptID=Integer.parseInt(System.console().readLine("Enter the DeptID="));
BloodGroup=System.console().readLine("Enter the BloodGroup=");
Salary=Integer.parseInt(System.console().readLine("Enter the Salary="));
}
void getEmpDetails()
{
System.out.println(" ");
System.out.println(" ");
System.out.println(" ");
System.out.println("************Employee Details**************");
System.out.println(" ");
System.out.println(" ");
System.out.println(" ");
System.out.println("Employee Id :"+empID);
System.out.println("Employee Name :"+empName);
System.out.println("Department Id :"+DeptID);
System.out.println("Employee Blood group :"+BloodGroup);
System.out.println("Employee Salary :"+Salary);
}
}
class EmployeeTestDrive
{
public static void main(String[] args)
{
Employee e=new Employee();
e.setEmpDetails();
e.getEmpDetails();
}
}
this is showing a lot of errors
ReplyDeleteno its not showing errors..its absolutely correct
ReplyDeletehow to use this with exceptions??
ReplyDeletewhere is the array of object???
ReplyDelete