
C# Inheritance Quiz
Authored by Dnyaneshwar Chaudhary
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
In C#, which keyword is used to define a class that inherits from another class?
A. base
B. extend
C. inherit
D. : (colon)
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the term for a class that cannot be instantiated and is only meant to be inherited from in C#?
A. Final class
B. Base class
C. Abstract class
D. Sealed class
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which keyword in C# is used to prevent a class from being inherited by other classes?
A. abstract
B. static
C. sealed
D. override
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following code?
class Country
{
public virtual void country()
{
Console.WriteLine("India");
}
}
class India : Country
{
public new void country()
{
Console.WriteLine("Best");
}
}
Country india=new Country();
Country India=new India();
India country=new india();
country.country();
A. "India"
"India"
"Best"
B. "India"
"Best"
"Best"
C. "Best"
"India"
"Best"
D. Compilation Error
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Suppose you have a base class Shape and two derived classes Circle and Rectangle. How would you implement method overriding in C# to calculate the area for each shape?
A. Use the base keyword in the derived class methods.
B. Use the new keyword in the derived class methods.
C. Use the virtual keyword in the base class and override keyword in the derived classes.
D. Use the override keyword in the base class and virtual keyword in the derived classes.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
8 questions
Subtraction Double Digit and Three Digit
Quiz
•
2nd - 3rd Grade
10 questions
A Pesquisa e a Comunidade do Vale
Quiz
•
University
9 questions
SALES G's & S's
Quiz
•
University
10 questions
NINTH GRADE I
Quiz
•
9th Grade
10 questions
Quiz sobre Funções em Programação
Quiz
•
2nd Grade
10 questions
Relationship Marketing
Quiz
•
11th Grade
10 questions
17 course French classical menu 01
Quiz
•
University
10 questions
QUIZ ON FREEDOM FIGHTERS
Quiz
•
1st - 2nd Grade
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade