C#.NET Multiple choices


Total available count: 28
Subject - Microsoft Technologies
Subsubject - C#.NET

Which of the following is correct about the below declaration?

public class A
{
     public virtual void Slightbook(){}
}
public class B:A
{
     public sealed override void Slightbook(){}
}

 


 

 

 

 



C


Solution:-

In C#, inheritance is a process in which one object acquires all the properties and behaviors of its parent object automatically. In such way, you can reuse, extend or modify the attributes and behaviors which is defined in other class.

For example, one for Mammal and one for WingedAnimal. The object size has therefore increased by two pointers, but now there is only one Animal and no ambiguity. All objects of type Bat will use the same pointers, but each Bat object will contain its own unique Animal object.

Below declaration, code Stoping virtual inheritance:

public class A
{
 public virtual void Slightbook(){}
}
public class B: A
{
 public sealed override void Slightbook(){}
}

 




Next 5 multiple choice(s)

1

Which of the following field cannot be virtual?

2

What is the use of a new keyword in polymorphism?

3

Which of the below is not a built-in delegate?

4

Which of the below is not a way to return multiple values?

5

How to print currency value in C#.Net?

Comments