Question 1) What will happen when you attempt to compile and run this code? abstract class Base{ abstract public void myfunc(). public void another(){ System.out.println("Another method"). }}public class Abs extends Base{ public static void main(String argv[]){ Abs a = new Abs(). a.amethod(). } public void myfunc(){ System.out.println("My Func"). } public void amethod(){ myfunc(). }} 1) The code will compile and run, printing out the words "My Func" 2) The compiler will complain that the Base class has non abstract methods 3) The code will compile but complain at run time that the Base class has non abstract methods 4) The compiler will complain that the method myfunc in the base class has no body, nobody at all to looove it
Question 2) What will happen when you attempt to compile and run this code? public class MyMain{public static void main(String argv){ System.out.println("Hello cruel world"). }} 1) The compiler will complain that main is a reserved word and cannot be used for a class 2) The code will compile and when run will print out "Hello cruel world" 3) The code will compile but will complain at run time that no constructor is defined 4) The code will compile but will complain at run time that main is not correctly defined
Question 3) Which of the following are Java modifiers?
1) public 2) private 3) friendly 4) transient 5) vagrant