MCQOPTIONS
Saved Bookmarks
This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Attributes knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of the following can implement an interface? 1.Data 2.Class 3.Enum 4.Structure 5.Namespace |
| A. | 2, 4 |
| B. | 1, 3 |
| C. | 4 only |
| D. | 3, 5 |
| Answer» B. 1, 3 | |
| 2. |
Which of the following statements are correct about an interface in C#.NET? 1.A class can implement multiple interfaces. 2.Structures cannot inherit a class but can implement an interface. 3.In C#.NET, : is used to signify that a class m |
| A. | 2, 4 |
| B. | 1, 2, 3 |
| C. | None of the above |
| D. | 3, 5 |
| Answer» C. None of the above | |
| 3. |
Which of the following is the correct way to implement the interface given below? |
| A. | class Employee : IPerson { private String str; public String FirstName { get { return str; } set { str = value ; } } } |
| B. | class Employee { private String str; public String IPerson.FirstName { get { return str; } set { str = value ; } } } |
| C. | class Employee : implements IPerson { private String str; public String FirstName { get { return str; } set { str = value ; } } } |
| D. | None of the above |
| Answer» B. class Employee { private String str; public String IPerson.FirstName { get { return str; } set { str = value ; } } } | |
| 4. |
Which of the following can implement an interface? |
| A. | 1, 3 |
| B. | 2, 4 |
| C. | 3, 5 |
| D. | 4 only |
| Answer» C. 3, 5 | |
| 5. |
Which of the following statements are correct about an interface used in C#.NET? |
| A. | 1, 2 |
| B. | 1, 4, 5 |
| C. | 3, 4 |
| D. | 3 only |
| Answer» C. 3, 4 | |
| 6. |
Which of the following is the correct implementation of the interface given below? |
| A. | class MyClass { double MyFun(Single i) as IMyInterface.MyFun { // Some code } } |
| B. | class MyClass { MyFun (Single i) As Double { // Some code } } |
| C. | class MyClass: implements IMyInterface { double fun(Single si) implements IMyInterface.MyFun() { //Some code } } |
| D. | class MyClass: IMyInterface { double IMyInterface.MyFun(Single i) { // Some code } } |
| Answer» E. | |
| 7. |
Which of the following statements are correct about an interface in C#.NET? |
| A. | 1, 2, 3 |
| B. | 2, 4 |
| C. | 3, 5 |
| D. | None of the above. |
| Answer» B. 2, 4 | |
| 8. |
Which of the following can be declared in an interface? |
| A. | 1, 3 |
| B. | 1, 2, 4 |
| C. | 3, 5 |
| D. | 4, 5 |
| Answer» C. 3, 5 | |