Thursday, July 30, 2009

I really find these questions confusing. can someone help?

An interface must meet which of these restrictions?





I. It must not have any fields.


II. All methods must be abstract.


III. Only public methods are allowed.


IV. A class can implement only one interface.





A. II and III only


B. I, II and III only


C. II, III and IV only


D. I, III and IV only


E. I, II,III and IV

I really find these questions confusing. can someone help?
A.





I really hope you are not majoring in Computer Science. Cheers.





To the poster below:


No, it's not E. Interfaces CAN have fields - compile time constants (ie. public static final int NUMBER = 2;). Classes can implement infinite number of interfaces.
Reply:I guess it's E.


No comments:

Post a Comment