OUTPUT GIVEN:Patrick 9123333,John 82323223
..this isthe class file
public class Employee{
private String name;
private int phoneNo;
public Employee(String name, int phoneNo){
this.name=name;
this.phoneNo=phoneNo;
}
public String toString()
{
return name+","+phoneo;
}
mAIN fILE
public class Organisation{
public static void main(String args[])
{
LinkedList
Employee employee;
employee=new Employee("John" ,82323223);
department=addFirst(employee);
employee=new Employee("Patrick",91233333);
department=addFirst(employee);
employee=new Employee("Mary" 123333)
/* to remove Mary from the list*/
department=removeFirst(employee);
for(int i=0;i
employee=department.get(i);
System.out.println(employee);
}
}
im just practising see how much i can rmb.. ahaha no harm...
No comments:
Post a Comment