C Sharp Polymorphism Questions and Answers
Practice ModeShowing 10 of 15 questions
Q1
Which of the following unary operators can be overloaded?
1 true
2 false
3 +
4 new
is
Answer: Option A
Q2
A derived class can stop virtual inheritance by declaring an override as
Answer: Option
Q3
Which of the following keyword is used to change the data and behavior of a base class by replacing a member of a base class with a new derived member?
Answer: Option A
Q4
Which of the following statements is correct?
Answer: Option A
Q5
Which of the following keyword is used to overload user-defined types by defining static member functions?
Answer: Option C
Q6
Which of the following statements is correct?
Answer: Option D
Q7
Which of the following statements are correct?
All operators in C#.NET can be overloaded.
We can use the new modifier to modify a nested type if the nested type is hiding another type.
In case of operator overloading all parameters must be of the different type than the class or struct that declares the operator.
Method overloading is used to create several methods with the same name that performs similar tasks on similar data types.
Operator overloading permits the use of symbols to represent computations for a type.
Answer: Option C
Q8
Which of the following statement is correct about the C#.NET code snippet given below?
public class Sample
{
public int x;
public virtual void fun()
{ }
}
public class DerivedSample : Sample
{
new public void fun()
{ }
}
Answer: Option A
Q9
Which of the following statements is correct?
Answer: Option A
Q10
Which of the following operators cannot be overloaded?
true
false
new
~
sizeof
Answer: Option C