Aggregation With and Without Using Generics
Aggregation With and Without Using Generics
package pack1;
import java.util.ArrayList;
class SportsPerson
{
private String name;
private int age;
private double h;
private double w;
class Country
{
private String name;
private int area;
private double population;
private String capital;
cobj.setSportsPerson("Dhoni",38,159,82);
cobj.setSportsPerson("Kholi",34,171,80);
cobj.setSportsPerson("Rohit",35,167,84);
System.out.println(cobj);
}
Aggregation Program without using Generics
package pack2;
class SportsPerson
{
private String name;
private int age;
private double h;
private double w;
class Country
{
private String name;
private int area;
private double population;
private String capital;