Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.
What is the Output of the following Java Program
{
Static String x="inside I1";
public void someMethod();
}
class A implements I1
{
public static void main(String args[[])
{
System.out.println("Calling I1 var ..."+I1.x);
}
}
Profile Answers by khadarzone Questions by khadarzone
Questions by khadarzone answers by khadarzone
Editorial / Best Answer
abuthahir.dProfile Answers by abuthahir.d Questions by abuthahir.d
Compilation error due to 2 reasons.
1. All variables defined in the Interfaces are implicitly public static final. So need not specify "Static" in interface.
2. If any of the member functions of a Interface is not Overriden , a compilation error will be thrown
Related Answered Questions
Related Open Questions