CIS2168 TEN MINUTE TEST #1 September 7, 2010 (5) 1. Assume that the class B extends the class A (A is abstract, B is concrete). Show which assignments are legal/not and why B b = new B(); A a = new A(); A c = b; B d = c; (10) 2. Why do we use Abstract classes, like Number, from Java API, or Shape as described in class? (5) 3. What is wrong with this code? explain. public class Temp { static int x; int y; public static void main(String[] args) { System.out.println(x); System.out.println(y); } } (15) 4. Implement the method public static double avg(int[][] a) that returns the average of the values stored in a. You can assume than nothing in a is null.