class Array_1
{
public static void main(String[] args)
{
int[] a={10,20,30,40,50};
for(int i=0; i<a.length;i++)
{
System.out.println(a[i]);
}
m1();
}
static void m1()
{
Emp[] e=new Emp[5];
Emp e1= new Emp(111,"ashutosh");
Emp e2= new Emp(222,"kumar");
Emp e3= new Emp(333,"singh");
Emp e4= new Emp(444,"lagatar");
Emp e5= new Emp(444,"naya");
Emp e6= new Emp(444,"purana");
Emp e7= new Emp(444,"aaj");
e[0]=e1;
e[1]=e2;
e[2]=e3;
e[3]=e4;
e[4]=e5;
for(Emp ee: e)
{
System.out.println(ee.id+"-----"+ee.name);
}
}
}
Thanks
Happy Programming!
{
public static void main(String[] args)
{
int[] a={10,20,30,40,50};
for(int i=0; i<a.length;i++)
{
System.out.println(a[i]);
}
m1();
}
static void m1()
{
Emp[] e=new Emp[5];
Emp e1= new Emp(111,"ashutosh");
Emp e2= new Emp(222,"kumar");
Emp e3= new Emp(333,"singh");
Emp e4= new Emp(444,"lagatar");
Emp e5= new Emp(444,"naya");
Emp e6= new Emp(444,"purana");
Emp e7= new Emp(444,"aaj");
e[0]=e1;
e[1]=e2;
e[2]=e3;
e[3]=e4;
e[4]=e5;
for(Emp ee: e)
{
System.out.println(ee.id+"-----"+ee.name);
}
}
}
Thanks
Happy Programming!
No comments:
Post a Comment