Question: 1. All Java classes are derived from A) java.lang. Class B) java.util. Name C) java.lang. Object D) java.awt.Window 2. When a programming class implements an


1. All Java classes are derived from A) java.lang. Class B) java.util. Name C) java.lang. Object D) java.awt.Window 2. When a programming class implements an interface, it must provide behavior for A) two methods defined in that interface B) any methods in a class C) only certain methods in that interface D) all methods defined in that interface 3. A method named myMethod() that needs two integer arguments is declared as A) public void myMethod(); B) public void myMethod(int a, int b); C) public void myMethod(int a, b); D) public int myMethod(a, b); ............ package is used by the compiler itself. So it does not need to be imported for use. A) java.math B) java.awt C) java.applet D) java.lang 5. What will be the result of compiling the following code? public class MyClass{ public static void main(String args[]){ System.out.println("In first main()); public static void main(char args[]){ System.out.println('a'); A) The code will not compile and will give Duplicate main() method declaration error B) The code will compile correctly but will give a runtime exception C) The code will compile correctly and will print In first main()" (without quotes) when it is run D) The code will compile correctly and will print a (without quotes) when it is run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
