Programming In Visual Basic Chapter 12

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is an abstract class?

  • A base class that can be instantiated
  • A class with overridden methods
  • A base class used strictly for inheritance (correct)
  • A class with no methods

What does Abstraction mean in OOP?

Creating a model of an object to determine characteristics and behaviors.

Use MustOverride keyword for an __________.

abstract method

What are accessor methods?

<p>Methods that allow class properties to be accessed.</p> Signup and view all the answers

Using _______ simplifies writing property procedures in VB 2010.

<p>auto-implemented properties</p> Signup and view all the answers

What is a base class?

<p>The original class used to create another class.</p> Signup and view all the answers

What is a child class?

<p>An inherited class.</p> Signup and view all the answers

Defining your new ___ is like creating a new tool for the toolbox.

<p>class</p> Signup and view all the answers

What is a constructor?

<p>Method that executes automatically when an object is instantiated.</p> Signup and view all the answers

If the class does not have a constructor, the compiler creates an implicit method called the _______.

<p>default constructor</p> Signup and view all the answers

What is a destructor?

<p>Method that executes automatically when an object is destroyed.</p> Signup and view all the answers

____ refers to the combination of all properties, methods, and events of an object.

<p>Encapsulating</p> Signup and view all the answers

What is garbage collection?

<p>A feature of the .NET Common Language Runtime that cleans up unused components.</p> Signup and view all the answers

What is inheritance in OOP?

<p>The ability to create a new class from an existing class.</p> Signup and view all the answers

The object that is created based on a class is called ____. An actual occurrence of the class is an ____.

<p>instance</p> Signup and view all the answers

What is an instance variable?

<p>A variable that belongs to an instance of a class.</p> Signup and view all the answers

The process of creating a new object is called ____. When you create a cookie using a cookie cutter, you __________ an object.

<p>Instantiate</p> Signup and view all the answers

What is a multitier application?

<p>An application that works in multiple layers.</p> Signup and view all the answers

What does the MustInherit keyword specify?

<p>That a class can only be used as a base class and cannot be instantiated directly.</p> Signup and view all the answers

What does the MustOverride keyword indicate?

<p>A method that can be overridden but has no implementation.</p> Signup and view all the answers

What is an object in OOP?

<p>A combination of code and data that can be treated as a unit.</p> Signup and view all the answers

What is overriding in OOP?

<p>Having a method in a subclass that has the same signature as a method in its base class.</p> Signup and view all the answers

What is a parameterized constructor?

<p>A constructor that requires arguments.</p> Signup and view all the answers

What is a parent class?

<p>The original class from which another class is derived.</p> Signup and view all the answers

What does polymorphism refer to in OOP?

<p>The ability to take on many shapes or forms.</p> Signup and view all the answers

The characteristics of the instances of classes are called a ____. You can refer to the _____ of your instances.

<p>Property</p> Signup and view all the answers

What is a property procedure?

<p>A procedure that provides access to the properties of a class.</p> Signup and view all the answers

What does the Protected keyword specify?

<p>That the element is accessible only within its own class or derived classes.</p> Signup and view all the answers

What does the ReadOnly keyword indicate?

<p>A property that can only be read and not modified.</p> Signup and view all the answers

What is reusability in OOP?

<p>A characteristic that allows the functionality from one class to be used in another.</p> Signup and view all the answers

What is a shared variable?

<p>A variable that exists for all objects of the class.</p> Signup and view all the answers

What is a subclass?

<p>The inherited class.</p> Signup and view all the answers

What is a superclass?

<p>The original class used to create another class.</p> Signup and view all the answers

In a property procedure, the value keyword is used to refer to the incoming value of the property using the SET statement with: SET...ClassVariable = ______.

<p>VALUE</p> Signup and view all the answers

What is visual inheritance?

<p>The feature that allows reusing a form's design for another form.</p> Signup and view all the answers

What is OOP (Object-oriented programming)?

<p>The most accepted style of programming.</p> Signup and view all the answers

What is Visual Basic.Net?

<p>The first version of VB that is truly object-oriented.</p> Signup and view all the answers

What is a method in OOP?

<p>An action or behavior that an object can perform.</p> Signup and view all the answers

The two steps for creating a new object are to declare a variable for the new object and __________.

<p>instantiate the object using the NEW keyword</p> Signup and view all the answers

What is MyBase.New()?

<p>An expression used to call the Base-Class Constructor.</p> Signup and view all the answers

What is overloading?

<p>Having several methods with the same name but different argument lists.</p> Signup and view all the answers

What are the components of a Three-Tier Application?

<p>Presentation tier, Business Service Tier, Data Tier.</p> Signup and view all the answers

To override a method, the original method must be declared as Overridable or MustOverride, and the new method must use the keyword __________.

<p>Overrides</p> Signup and view all the answers

What is the Object Browser?

<p>A tool used to view classes, properties, methods, and events.</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

Object-Oriented Programming Concepts in Visual Basic

  • Abstract Class: A base class intended solely for inheritance, defined with MustInherit. Cannot create instances directly; requires subclasses to override defined methods using MustOverride.

  • Abstraction: Modeling of real-world entities to determine their properties and methods; aids in the planning stages of object-oriented (OO) programs by identifying needed classes.

  • Abstract Method: Declared with the MustOverride keyword, serves as a placeholder for methods that must be implemented in derived classes; contains no functionality on its own.

  • Accessor Methods: Provide a way to access class properties, using GET for retrieving values and SET for updating them.

  • Auto-Implemented Property: Introduced in VB 2010, allows the declaration of class properties without explicitly defining GET or SET procedures; the compiler automatically generates this structure.

  • Base Class: The original class, also known as the superclass or parent class, from which other classes derive.

  • Child Class: The class that inherits from a base class, also referred to as a subclass or derived class.

  • Class Definition: A blueprint for creating objects; defines the structure and behavior but does not create instances itself.

  • Constructor: A special method invoked automatically upon instantiation of an object using NEW. Ideal for initialization tasks; must be defined in every class unless a default constructor suffices.

  • Default Constructor: An implicit constructor generated by the compiler if none are defined; has no parameters.

  • Destructor: Method that executes when an object is destroyed, called Finalize in VB, typically used for cleanup tasks.

  • Encapsulation: Bundling of properties, methods, and events in a single unit to promote data hiding; variables should be declared as Private or Protected.

  • Garbage Collection: A feature of the .NET CLR that automatically cleans up unused objects, freeing memory and resources. It activates any defined Finalize procedures.

  • Inheritance: Mechanism to create new classes based on existing ones, enabling enhancements without altering the original; allows use of base class functionality in derived classes.

  • Instance: A specific occurrence of a class; every object created from the class represents an instance, allowing for multiple objects based on a single class definition.

  • Instance Variable: A variable specific to an instance of a class; each object maintains a separate copy, unlike shared variables.

  • Instantiate: The process of creating a new object from a class; involves declaring a variable and using NEW to initialize it.

  • Multitier Application: Design strategy that separates application functions across multiple layers, enhancing modularity and deployment flexibility.

  • MustInherit & MustOverride: Keywords indicating that a class is abstract and cannot be instantiated directly, and methods that require overriding in derived classes, respectively.

  • Object: An instantiation of a class that combines code and data, capable of generating events and possessing properties and methods.

  • Overriding: A feature allowing subclass methods to have the same name as those in the base class but with distinct implementations.

  • Parameterized Constructor: A constructor requiring arguments, facilitating passing parameters during object creation.

  • Polymorphism: Ability of methods to operate under multiple forms; allows method calls to be made across different classes that implement the same method signatures differently.

  • Property: Characteristics of class instances, can be retrieved or modified, representing attributes like flavor or topping in a cookie object.

  • Property Procedure: Facilitates external access to class properties; includes methods for manipulating property values through SET and GET.

  • Protected Modifier: Limits access to class elements, making them available only within that class or its subclasses.

  • ReadOnly Modifier: Specifies that a property can only be read and not modified, restricting access to its GET procedure.

  • Reusability: One of the primary advantages of OOP, allowing functionalities from one class to be utilized in another, enhancing code efficiency and reducing redundancy.

  • Shared Variable: Declared with the Shared keyword, these variables exist for all instances of a class, unlike instance variables which are unique to each instance.

  • Visual Inheritance: A feature that allows a derived form to inherit design properties from a base form, promoting consistency in UI design.

  • Three-Tier Application Architecture: Divided into:

    • Presentation Tier: User interface components.
    • Business Service Tier: Validation, calculations, and business logic.
    • Data Tier: Handles data storage and retrieval.
  • Steps to Override a Method: Use Overridable or MustOverride in the base class method and Overrides keyword in the derived class method.

  • Object Browser: A tool for exploring classes, properties, methods, and events, useful for understanding system and user-defined classes.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Like This

C# Overview and Basics
16 questions
CS341 Week 05: OOP in Visual Programming
24 questions
Visual Basic 2010 Basics
24 questions

Visual Basic 2010 Basics

PicturesqueSugilite5089 avatar
PicturesqueSugilite5089
Use Quizgecko on...
Browser
Browser