C# Flashcards
_______ means “many forms”, and it occurs when we have many classes that are related to each other by inheritance. Inheritance lets us inherit attributes and methods from another class. ________ uses those methods to perform different tasks.
Polymorphism
May or may not include ______ methods. Also cannot be instantiated, but they can be subclasses. A method declared without an implementation. If a class includes_____ methods, then the class itself must be declared ______?
Abstract Methods and Classes
Abstract type that contains a collection of methods and constant variables. It is one of the core concepts in java, and used to achieve abstraction, polymorphism and multiple inheritances.
Interfaces
Two or more methods may have the same name if they differ in parameters(different number of parameters, different types of parameters, or both). These methods are called overloaded methods and this feature is called method ______?
Overloading
______ occurs when a subclass (child class) has the same method as the parent class. In other words, ______ occurs when a subclass provides a particular implementation of a method declared by one of its parent classes.
Overriding
This function or method type in an OOP language is used to override the behavior of the function or method in an inherited class with the same signature to achieve the polymorphism.
Virtual Method
ways of parameter passing, one way doesn’t require initialization.
out, in, ref
Is a concept that acquires the properties from one class to other classes; for example, the relationship between father and son. Is a process of acquiring all the behaviors of a parent object.
Inheritance
A _____ between two objects associated with each other exists when there is a strong relationship between one class and another. Other classes cannot exist without the owner or parent class.
Composition
Is a keyword for creating a structure that contains variables, methods, different types of constructors, operators, etc. It is similar to classes that hold different types of data and has a value type. It creates objects which require less memory.
Struct
A template definition of the methods and variables in a particular kind of object. Thus, an object is a specific instance of this. Is one of the defining ideas of object-oriented programming.
Class
Is a method that is not bound to an identifier. Often used as arguments being passed to higher-order functions or used for constructing the result of a higher-order function that needs a return method.
Anonymous Method
Simply passing a duty off to someone or something else. Can be an alternative to inheritance. Means you use an object of another class an an instance variable, and forwards messages to the instance.
Delegates
Used for the export of variables, methods, and resources by name.
DLL(Dynamic Link Library)
managed .NET assemblies created using third-party tools and usually contains .NET code that can only access .NET supported libraries.
Managed plugins
platform-specific native code libraries. They are used to access third-party code libraries that would normally not be available to Unity otherwise.
Native plugins
Can threads be used to modify a texture on runtime?
No, texture and meshes are examples of elements stored in GPU memory and Unity doesn’t allow other threads, besides the main one, to make modifications on these kinds of data.
can threads be used to move a GameObject in the scene?
no, fetching the transform reference isn’t thread safe in Unity.
class RandomGenerator : MonoBehaviour { public float[] randomList;
void Start() { randomList = new float[1000000]; }
void Generate() { System.Random rnd = new System.Random(); for(int i=0;i
class RandomGenerator : MonoBehaviour { public float[] randomList;
void Start() { randomList = new float[1000000]; Thread t = new Thread(delegate() { while(true) { Generate(); Thread.Sleep(16); // trigger the loop to run roughly every 60th of a second } }); t.Start(); }
void Generate() { System.Random rnd = new System.Random(); for(int i=0;i
Define primitive data types?
Primitive data types are predefined data types such as byte, sbyte, int, uint, short, ushort, long, ulong, float, double, char, bool, object, string, decimal.
What is unsigned vs signed variables?
only numerical variables have signed vs unsigned types. Unsigned is 0 to max. Signed is -min to -max.
what are non-primitive data types?
non-primitive data types are user-defined data types such as enum, class, etc.
Explain the difference between an object and a structure?
Generally speaking, objects bring the full object oriented functionality (methods, data, virtual functions, inheritance, etc, etc) whereas structs are just organized memory. Structs may or may not have support for methods / functions, but they generally won’t support inheritance and other full OOP features.
Are you familiar with 3D math well enough to answer questions about it? If they ask you simple vector math questions like how to find the direction from vector A to Vector B could you answer that?
To find the vector between point A and point B, merely subtract the two vectors to get an angled vector pointing between the two points.