• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

interface

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
This question is from a Mock Test.
Which of the following is true ?
a. Subclasses must define all the methods that the superclass defines.
b. A class must define all the methods in the interface that it says it implements.
c. A class can't override the super class's constructor.
d. It is possible for 2 classes to be superclass of each other.
e. An interface can implement multiple interfaces.
My answers were ....
a. False.
b. True // Note
c. True
d. False never. ClassCircularityError occurs
e. False it can only extend multiple interface

But the test says the right answer is only c.
I think this is true
b. A class must define all the methods in the interface that it says it implements.

Aruna.
[This message has been edited by Aru (edited August 31, 2000).]
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
unless it is declared as abstract...
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Aruna, no, the only answer is C.
Answer b(A class must define all the methods in the interface that it says it implements) is wrong because a class does not implement all the methods in an interface. In this case this class is an abstract class, must be declared as abastract.
With regards!
Frank
 
Aru
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thx , Yes..unless it is abstract.
Aruna
 
I am mighty! And this is a mighty small ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic