MCQs on Object-Oriented Programming in VB.NET | Visual Basic .NET (VB.NET)

Dive into the core concepts of VB.NET’s Object-Oriented Programming (OOP). Test your understanding of classes, objects, properties, methods, events, encapsulation, inheritance, and polymorphism with these targeted questions.


Object-Oriented Programming in VB.NET MCQs

Classes and Objects

  1. Which keyword is used to create a new instance of a class in VB.NET?
    • a) New
    • b) Class
    • c) Object
    • d) Create
  2. What is the main purpose of a class in VB.NET?
    • a) To define the structure of objects
    • b) To execute methods directly
    • c) To handle exceptions
    • d) To display output
  3. In VB.NET, what is the correct syntax to define a class?
    • a) Create Class ClassName
    • b) Define ClassName
    • c) Class ClassName
    • d) New ClassName
  4. Which of the following is true about objects?
    • a) Objects can only store methods.
    • b) Objects are instances of classes.
    • c) Objects are defined without classes.
    • d) Objects cannot have properties.
  5. How do you access a method of an object in VB.NET?
    • a) Object.Method()
    • b) Object->Method()
    • c) Method.Object()
    • d) Call Method.Object

Properties, Methods, and Events

  1. What is a property in VB.NET?
    • a) A method with no parameters
    • b) A variable that stores data
    • c) A member used to get or set values
    • d) An event trigger
  2. How can you define a property in VB.NET?
    • a) Using the Dim keyword
    • b) Using the Property keyword
    • c) Using the Function keyword
    • d) Using the Sub keyword
  3. What does the “Set” block of a property do?
    • a) Reads the property value
    • b) Updates the property value
    • c) Deletes the property
    • d) Initializes the property
  4. Which statement is true about methods in VB.NET?
    • a) They are used to declare variables.
    • b) They are functions or subroutines within a class.
    • c) They are events triggered during runtime.
    • d) They cannot accept parameters.
  5. How can you handle an event in VB.NET?
    • a) Using the Event keyword
    • b) Using the Handles keyword
    • c) Using the Triggers keyword
    • d) Using the Raise keyword

Encapsulation, Inheritance, and Polymorphism

  1. What does encapsulation mean in VB.NET?
    • a) Grouping data and methods into a class
    • b) Dividing a program into modules
    • c) Using multiple methods with the same name
    • d) Overriding methods in subclasses
  2. How is inheritance implemented in VB.NET?
    • a) Using the Implements keyword
    • b) Using the Inherits keyword
    • c) Using the Override keyword
    • d) Using the Extends keyword
  3. Which is a benefit of inheritance in VB.NET?
    • a) Improved data encapsulation
    • b) Code reusability and hierarchy
    • c) Reduced class size
    • d) Prevents method overriding
  4. What is polymorphism in VB.NET?
    • a) A way to create multiple classes
    • b) Allowing methods to take many forms
    • c) Storing multiple values in a single variable
    • d) Encapsulation of objects
  5. Which type of polymorphism involves method overriding?
    • a) Static polymorphism
    • b) Dynamic polymorphism
    • c) Hybrid polymorphism
    • d) Functional polymorphism
  6. What keyword is used to override a base class method in VB.NET?
    • a) Override
    • b) Overloads
    • c) Extends
    • d) New
  7. In VB.NET, which access modifier restricts access to a class and its derived classes?
    • a) Private
    • b) Protected
    • c) Public
    • d) Friend
  8. Which concept ensures that internal details of a class are hidden?
    • a) Inheritance
    • b) Encapsulation
    • c) Polymorphism
    • d) Overloading
  9. What is the term for a method that has the same name but different parameters?
    • a) Method overriding
    • b) Method hiding
    • c) Method overloading
    • d) Method extension
  10. What is the default access level for members of a class in VB.NET?
    • a) Private
    • b) Public
    • c) Protected
    • d) Friend

Answers

QnoAnswer (Option with the Text)
1a) New
2a) To define the structure of objects
3c) Class ClassName
4b) Objects are instances of classes
5a) Object.Method()
6c) A member used to get or set values
7b) Using the Property keyword
8b) Updates the property value
9b) They are functions or subroutines
10b) Using the Handles keyword
11a) Grouping data and methods into a class
12b) Using the Inherits keyword
13b) Code reusability and hierarchy
14b) Allowing methods to take many forms
15b) Dynamic polymorphism
16a) Override
17b) Protected
18b) Encapsulation
19c) Method overloading
20a) Private

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top