Ok so I have studied java all semester and thought I had a clear understanding about inheritance and super/sub classes. Today we were given as assignment for making a superclass
package com.action.product;
public class ProductAction{
public static String strCategoryName;
public String getStrCategoryName() {
return strCategoryName;
}
public void setStrCategoryName(String strCategoryName) {
this.strCategoryName = strCategoryName;
}
}
-----------------------------------------------------------------------
package com.DAO.product;
public class ProductDAO extends ProductAction {
@SuppressWarnings("static-access")
public String addnewProductValidation(){
System.out.println("======through_name======="+super.strCategoryName);
System.out.println("======through_getters======="+super.getStrCategoryName());
}
}
Can initialize variables as static. No need to create object