Omni Flashcards
(202 cards)
What is a Delegate?
A way of passing behavior as a parameter
What are Default Constructors?
Methods that don’t return anything or take any parameters
What are Static Members shared between?
Static Members are shared between Instances of a Class
What is a Model?
A Model is an abstraction of something
What does the “new” keyword do?
It allocates memory at run time
What is Inheritance?
If a Class B inherited from Class A then it contains all characteristics (information structure and behavior) of Class A
What is a naive way of writing code line by line?
Procedural Programming
What is Error Handling?
Error Handling is the term for all techniques involving Finding and Correcting Errors
What are the 3 categories that Operators can be divided into?
Unary, Binary, and Ternary
What is the term for a variable in a Struct?
a Data Member
In C#, what is a Field?
A Field is a Variable of any type that is declared directly in a Class or Struct. Fields are Members of their containing type.
What is the difference between a Function and a Method?
A Method is a special type of function with an Implicit Argument Passed (an instance of the class that the method is defined on). This is important, as a Function, in strict terms, should not use or modify anything not in its argument list
Where can you access Private Members from?
Only from Inside the Class
In a Switch statement, it is legal to execute more than one case?
Yes
Can you instantiate an Abstract class?
No
What is the “Diamond Problem”?
In multiple Inheritance, if intermediate classes inherit from same base class then the 3rd level of child class will have the same behavior from two classes
What is Association in OOP?
Object interaction with each other is called Association
What are the 2 main types of Association?
- Class association (inheritance)
- Object association (simple association, composition, aggregation)
What is the difference between “.” and “->” ?
The dot operator “.” accesses type through name
The arrow key operator “->” accesses type through a pointer
What is the purpose of the scope resolution operator?
If you declare a Function inside a Class and define it Outside the Class then you need to use the Scope Resolution Operator “::”
What is a Constructor?
A Constructor is used to Initialize the Objects of Class. The Constructor is automatically called when the Object is Created. It does not have return type.
What is a Destructor?
A Destructor is used to free the memory that is allocated through dynamic memory allocation. It destroys an object when it goes out of scope. Destructors use “~” as prefix
Can Destructors be overloaded?
Yes
How is a Destructor called?
In reverse order