CIS2168 TEN MINUTE TEST #1 January 26, 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 a. B b = new B(); b. A a = new A(); c. A c = b; d. B d = c; (5) 2. What is the Java JVM? what does it do? Why do we say that it justifies the saying "Write it once, run it everywhere"? (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.