class Student
{
public int a,b,c,d;
public Student(int w,int x,int y,int z)
{
a=w;
b=x;
c=y;
d=z;
}
public void calAverage()
{
System.out.println((a+b+c+d)/4);
}
}
========================================================
class Test
{
public static void main(String args[])
{
Student xyz = new Student (40,40,40,40);
xyz.calAverage();
}
}
{
public int a,b,c,d;
public Student(int w,int x,int y,int z)
{
a=w;
b=x;
c=y;
d=z;
}
public void calAverage()
{
System.out.println((a+b+c+d)/4);
}
}
========================================================
class Test
{
public static void main(String args[])
{
Student xyz = new Student (40,40,40,40);
xyz.calAverage();
}
}
No comments:
Post a Comment