C# Flashcards
What is a statically typed language?
Static typing is where the type is bound to the variable. Types are checked at compile time. C# and Java are statically typed languages.
What is a dynamically typed language?
Dynamic typing where the type is bound to the value. Types are checked at run time. PHP and JavaScript are dynamically typed languages.
What is a strongly typed language?
Strongly typed languages will not allow automatic conversion from one type to another. It does not allow for type coercion. Python is a strongle typed language.
What is a weakly typed language?
Weakly typed languages do allow for automatic conversion from one type to another. It allows for type coercion. JavaScript is a weakly typed language.
What does type safe mean?
Type safety is the idea that you can only interact with an object in ways that are allowed by that object. For example, C# prevents you from interacting with a string type as if it were an integer type.
What does memory safe mean?
Memory safety is a property of programming languages where all memory access is well defined. Most programming languages in use today are memory safe because they use some form of garbage collection.
What is a value type?
A value type is the actual value. If it is declared within the body of a method then it is placed on the stack. If a value type is declared inside a reference type then is will be placed within the reference type on the heap.
What is a reference type?
A reference type’s value is stored in the Heap. It is accessed by a pointer. The pointer is stored in the Stack which points to an address in the Heap where the real value is stored.
In memory what is the Stack?
The Stack keeps track of what’s executing in the code. It is self maintaining and takes care of its own memory management.
In memory what is the Heap?
The Heap’s purpose is to hold data, so anything in the the Heap can be accessed at any time. The heap contains Reference Type values. It is garbage collected.
What is a namespace?
A namespace is a way to logically arrange classes, interfaces, structs, etc. into their own named space. It’s used to provide context for the compiler for all named information in the program.
What is a using statement?
It explicitly tells the compiler that you’ll be using a certain namespace in the program. A developer can avoid having to fully qualify classes with the namespace in every instance of typing it.
What is an access modifier?
They are keywords that define the accessibility of a member, class or datatype in a program. It can restrict unwanted access by external programs or classes.
What is the default access modifier for a class?
internal
What is the default access modifier for a type member?
private