C# Fundamentals Flashcards
What is the CLR?
Common Language Runtime - works in background
- Manages memory
- OS and hard independence
- Language independence; many langs
What is FCL?
Framework Class Library
- library of functionality to build apps
- large and varied
- typically focus on specific areas (ASP.NET)
What languages fed C#?
Java, C++ and JavaScript
What is csc?
Visual C# Compiler - csc.exe
csc file.cs
What does compiler do?
- Transforms C# into MSIL (MS Intermediate Language)
What are “Members”?
Basically everything within the curly braces of a Class. Everything contained within that Class.
What do Class Members define?
- State (a Field)
- Behavior - members that do work (Methods)
What does adding an “f” next to a number do?
Tells the program the number should be treated as a FLOAT
What is a Constructor?
- Special methods used to initialize objects
- All classes have an implicit constructor
- You can explicitly define a custom constructor (or multiple)
What is snippet for adding a Constructor?
- “ctor” then tab tab
What are reference types?
- Classes are reference types
- Variable holds pointer value, pointer to memory
- Multiple variables can point to same object; same point in memory
What are Access Modifiers?
- public, private, etc
- public - publically available
- default is private
What is Encapsulation?
- Hiding or not exposing some of the details of code
- Only exposing members you want to expose
What is static?
- Use static members of class without creating an instance
What is assembly?
- Compiled code in form of exe or DLL
- instructions for code to run on the CLR
What is Unit Testing?
- VS has Unit Test Project
- Use Code to test Code
What is the default access modifier for a new Class?
- the default is Internal
- this means the class can only be accessed within same project