C++ Object Oriented Programming Methods

UseableRomanesque avatar
UseableRomanesque
·
·
Download

Start Quiz

Study Flashcards

10 Questions

C# provides ______ that shorten the syntax for single-line methods.

expression-bodied members

A local function is a function declared inside another ______.

function

Static methods can be called directly without creating a class ______.

instance

The previous method can be rewritten using ______ that shorten the syntax for single-line methods.

expression-bodied members

A local function is a function declared inside another ______.

function

You can define a local function that can be called only within the method where the local function is defined. This prevents the local function from accessing the main method variables directly. To prevent this type of mistake, add the ______ modifier to the local function:

static

The default manner in which a value type parameter is sent into a function is by ______. A copy of the data is passed into the function.

value

Methods taking output parameters (via the out keyword) must assign them to a value before exiting the method scope. This method returns the sum of two integers using the ______ modifier.

out

You can use parameter modifiers to control how arguments are passed to a method. When a parameter does not have a modifier, the behavior for value types is to pass in the parameter by ______.

value

The contained Add() method can be called only from the wrapping AddWrapper() method. To prevent this type of mistake, add the ______ modifier to the local function:

static

Learn about methods in C++ object oriented programming, including method parameters, expression-bodied members, local functions, static local functions, and various method modifiers. Understand method overloading and how to define methods with access modifiers and return types.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser