You are not logged in.
Pages:: 1
#1 2015-06-15 08:43:13
Java Compile Error:
Java Quizzes Java Language Access Control And Declaration
Directions:
static public class Test{
public static void main(String[] args){
char c = 'a';
switch(c){
case 65 : System.out.println("one");break;
case 'a': System.out.println("two");break;
case 3 : System.out.println("three");
}
}
}
Question:
What will be the output for the below code?
Option A):
two
Option B):
Compile error - char can't be permitted in switch statement
Option C):
one
Option D):
Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted
Correct Answer is Option D):
Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-15 08:43:13
- Advertisement
- Ads By Google
Re: Java Compile Error:
\n
Pages:: 1