System.out.println(“error2”);
}
}
}
}
7.class GrandFather{
GrandFather(){System.out.println(“GrandFather”);}
}
class Book{
Book(){System.out.println(“Book”);}
}
class Father extends GrandFather{
Father(){System.out.println(“Father”);}
}
public class Son extends Father{
private Book b=new Book();
public Son(){System.out.println(“GrandFather”);}
public static void main(String args[]){
new Son();
}
8.class Count{
public static int counter=0;
public Count(){
counter++;
}
public int getCount(){
return counter;
}
}
public class StaticTest{
public static void main(String[]args){
Count[]c=new Count[5];
for(int i=0;i c[i]=new Count(); System.out.println(c[i].getCount()); } } } 9.public class Calculation{ public float avg(int...nums){