Q-1: === class Employee extends Employer{ public Employee(){ super(); } } =============================== class Student{ public Student(){ super(); } } ==> For any class "Object class" act as Parent Class. ==> from the above scenario, the super() can invoke Object class's default constructor. ================================================================== /* * WAP in Java to create the ArrayList to store Employee Object. * And Display the information of Female Employees only. * And also display the employee information who are having above 5 years of experience. */ package pack1; import java.util.ArrayList; import java.util.Iterator; class Employee{ private int empNo; private String ename; private double salary; private String gender; private double experience; // creating the constructor for initializing class data members public Employee(int empNo, String ename, double salary, String gender, double experience) { super(); this.empNo = empNo; this.ename = ename; this.salary = salary; this.gender = gender; this.experience = experience; } // defining setters and getters public int getEmpNo() { return empNo; } public void setEmpNo(int empNo) { this.empNo = empNo; } public String getEname() { return ename; } public void setEname(String ename) { this.ename = ename; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public double getExperience() { return experience; } public void setExperience(double experience) { this.experience = experience; } // generate toString() @Override public String toString() { return "Employee [empNo=" + empNo + ", ename=" + ename + ", salary=" + salary + ", gender=" + gender + ", experience=" + experience + "]"; } } public class MainClass { private static ArrayList getEmployeeList(){ ArrayList empList = new ArrayList<>(); empList.add(new Employee(7928,"Amisha",55000.0,"Female",3.5)); empList.add(new Employee(7929,"Ashok",45000.0,"Male",3.2)); empList.add(new Employee(7930,"Akshay",25000.0,"Male",1.5)); empList.add(new Employee(7931,"Bhavana",76000.0,"Female",5.5)); empList.add(new Employee(7932,"Keerthi",45000.0,"Female",3.0)); empList.add(new Employee(7933,"Vijay Gopal",105000.0,"Male",6.5)); empList.add(new Employee(7934,"Vijay",35000.0,"Male",1.5)); empList.add(new Employee(7935,"Vinitha",45000.0,"Female",3.0)); empList.add(new Employee(7936,"Vignesh",125000.0,"Male",6.7)); empList.add(new Employee(7937,"Ananya",119000.0,"Female",7.1)); return empList; } public static void main(String[] args) { ArrayList empList = getEmployeeList(); // method is calling Iterator it = empList.iterator(); // creating an iterator object System.out.println("Getting of Female Employee DEtails.."); while(it.hasNext()) { Employee emp = it.next(); if(emp.getGender().equalsIgnoreCase("Female")) { System.out.println(emp); } } System.out.println("==================================================="); System.out.println("Getting 5+ Years of Experience People details..."); Iterator ir = empList.iterator(); while(ir.hasNext()) { Employee emp = ir.next(); if(emp.getExperience() >= 5) { System.out.println(emp); } } } } ====================================================== Q: is it possible to invoke the static method in another static method without the reference of class name? Ans: Yes, when both static methods are from same class. class A{ static void m1(){ .... m2(); } static void m2(){ ..... m1(); } } =============================== Here: m1() and m2() are from two different classes. to call m1() in m2() we must use the className as reference. class ClassA{ static void m1(){ } } class ClassB{ static void m2(){ ClassA.m1(); } } ====================================================================== Q: Can we store arraylist object into list variable? Ans:Yes class A{ public static ArrayList getEmployeeList(){ // logic return ArrayListObject; } } class MainClass{ public static void main(String[] args) { List listEmp = getEmployeeList(); } } ============================================= interface Vehicle{ } class Car implements Vehicle{ } class MainClass{ public static void main(String[] args) { Vehicle v = new Vehicle(); // error, because object creation not possible for interface Vehicle v = new Car(); } } ========================================================= interface Vehicle{ start(); } class Car implements Vehicle{ start(){ } stop(){ } } class MainClass{ public static void main(String[] args) { // Vehicle v = new Vehicle(); // error, because object creation not possible for interface Vehicle v = new Car(); v.start(); // correct v.stop(); // error Car c = new Car(); c.start();// correct c.stop(); // correct } }