Sail E0 Webinar
Question
What will be the output?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()); }}
Options:
A .  Compilation fails due to an error on lines 2
B .  Compilation fails due to an error on lines 1
C .  test-name
D .  Compilation succeed but Runtime Exception
E .  None of these
Answer: Option A

Submit Your Solution Below and Earn Points !

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers