Java Question
1. Create a POJO Class (Employee) with these properties:
i. ID
ii. Age
iii. Name
2. Write the class to read into the memory. (Reader to read into the memory).
3. Write a Junit test for the Employee class.
Employee Class:
class employee// class as asked
{
public String id;
public int age;
public String name;
employee(String id, int age, String name)
{
this.id=id;
this.name=name;
this.age=age;
}
public static void main (String[] args) throws Exception// main program that test the class
{
employee e=new employee("12345",21,"Jack");
String name="Jack";
String id="12345";
Integer age=21;
System.out.println(name.equals(e.name));
System.out.println(id.equals(e.id));
System.out.println(age.equals(e.age));
}
}
Junit Test:
Get Answers For Free
Most questions answered within 1 hours.