Home
About Us
Contact Us
Bookmark
Saved Bookmarks
Current Affairs
General Knowledge
Chemical Engineering
UPSEE
BSNL
ISRO
BITSAT
Amazon
ORACLE
Verbal Ability
→
Java Programmer Tutorial
→
Java Programmer Interview Questions in Java Programmer Tutorial
→
All Members Of Interface Are Public By Default. T...
1.
All Members Of Interface Are Public By Default. True Or False?
Answer»
True.
True.
Show Answer
Discussion
No Comment Found
Post Comment
Related InterviewSolutions
Can You Identify The Errors In The Below Code? Interface I { Class C Implements I { Public Void Method(int I) { System.out.println(i); } } Void Method(int I); }
What Will Be The Output Of The Following Program? Class A { } Class B Extends A { } Class C Extends B { } Interface Abc { Void Method(a A); } Interface Pqr { Void Method(b B); } Class M Implements Abc, Pqr { Public Void Method(a A) { System.out.println(2); } Public Void Method(b B) { System.out.println(3); } } Public Class Mainclass { Public Static Void Main(string[] Args) { M M = New M(); M.method(new A()); M.method(new B()); M.method(new C()); } }
Is The Below Program Written Correctly? If Yes, What Will Be The Output? Interface I { Class C { Int I; Public C(int I) { This.i = ++i; } Int Methodc() { Return ++i; } } } Public Class Mainclass { Public Static Void Main(string[] Args) { I.c C = New I.c(000); System.out.println(c.method()); } }
What Will Be The Output Of The Following Program? Abstract Class A { Abstract Void Mymethod(number N); } Interface B { Abstract Void Mymethod(object O); } Class C Extends A Implements B { Void Mymethod(number N) { System.out.println("number"); } Public Void Mymethod(object O) { System.out.println("object"); } } Public Class Mainclass { Public Static Void Main(string[] Args) { A A = New C(); A.mymethod(new Integer(121)); B B = New C(); B.mymethod(new Integer(121)); C C = New C(); C.mymethod(new Integer(121)); } }
Can We Define Interface As Generic?
Can You Identify The Error In The Below Code? Interface X { Void Methodx(); } Interface Y Extends X { Void Methody(); } Class Z Implements Y { Public Void Methody() { System.out.println("method Y"); } }
Interfaces Are Abstract And Public By Default. True Or False?
Can You Identify The Error In The Below Code? Class A Implements A.b { Static Interface B { Void Methodb(); } }
Is The Below Program Written Correctly? If Yes, What Will Be The Output? Interface X { Void Methodx(); Interface Y { Void Method(); } } Class Z Implements X, X.y { { Method(); System.out.println(1); } Public Void Methodx() { Methody(); System.out.println(2); } Public Void Methody() { System.out.println(3); } } Public Class Mainclass { Public Static Void Main(string[] Args) { Z Z = New Z(); Z.methodx(); Z.methody(); X X = Z; X.methodx(); } }
What Will Be The Output Of The Following Program? Interface A { String A = "aaa"; String Methoda(); } Interface B { String B = "bbb"; String Methodb(); } Class C Implements A, B { Public String Methoda() { Return A+b; } Public String Methodb() { Return B+a; } } Class D Extends C Implements A, B { String D = "ddd"; Public String Methoda() { Return D+methodb(); } } Public Class Mainclass { Public Static Void Main(string[] Args) { C C = New C(); System.out.println(c.methoda()); System.out.println(c.methodb()); C = New D(); System.out.println(c.methoda()); System.out.println(c.methodb()); } }
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies