1. Which of the following statements about interfaces is not true? a. An interfa
ID: 3603519 • Letter: 1
Question
1. Which of the following statements about interfaces is not true?
a.
An interface can only declare abstract members.
b.
An interface can inherit other interfaces.
c.
A class can only implement a single interface.
d.
A class that implements an interface must provide an implementation for every member of the interface.
2. Which of the following is a difference between interfaces and abstract classes?
a.
None of the members of an interface can be implemented, but some of the members of an abstract class can be.
b.
An interface can declare static members, but an abstract class can’t.
c.
An interface can’t inherit multiple classes, but an abstract class can.
d.
All of the above.
3. Which of the following declares a class named Student that inherits a class named Person and implements the ICloneable interface?
a.
public class Student : Person, ICloneable
b.
public class Student : ICloneable, Person
c.
public class Student : Person : ICloneable
d.
public class Student : ICloneable : Person
4. Given an interface named IWriteable, what type of object can be passed to the Save method with the following declaration?
public bool Save(IWriteable obj)
a.
any object
b.
any object that implements the IWriteable interface
c.
any object that implements the Save method
d.
only objects created from the IWriteable class
a.
An interface can only declare abstract members.
b.
An interface can inherit other interfaces.
c.
A class can only implement a single interface.
d.
A class that implements an interface must provide an implementation for every member of the interface.
Explanation / Answer
1 ans-(c). A class can implement only a single interface.
2 ans-(a), None of the members of an interface can be implemented, but some of the members of an abstract class can be.
3 ans-(a). public class Student : Person, ICloneable
4 ans-(b). any object that implements the IWriteable interface
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.