You are not logged in.
Pages:: 1
#1 2015-06-13 05:00:04
Compilation Fails:
Java Quizzes Java Language Interfaces And Abstract Classes
Directions:
1. public interface InfA{
2. protected String getName();
3. }
public class Test implements InfA{
public String getName(){
return "test-name";
}
public static void main (String[] args){
Test t = new Test();
System.out.println(t.getName());
}
}
Question:
What will be the output?
Option A):
Compilation succeed but Runtime Exception
Option B):
Compilation fails due to an error on lines 1
Option C):
test-name
Option D):
Compilation fails due to an error on lines 2
Correct Answer is Option D):
Compilation fails due to an error on lines 2
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-13 05:00:04
- Advertisement
- Ads By Google
Re: Compilation Fails:
\n
Pages:: 1