C# Flashcards
(79 cards)
What is the CLR
Common Language Runtime
What does the C# compiler do?
It takes the C# code and transforms it into Microsoft Intermediate Language. If there are multiple files, it will produce a single executable or library. (And produce an executable?)
What is MISL/what does it do?
Microsoft Intermediate Language. MISL Defines instructions for the CLR
What does the CLR do?
Reads the MISL (Microsoft Intermediate Language) instructions and transforms intro instructions that the CPU on your machine will understand. (Native instructions)
What are native instructions?
Instructions that work on the real hardware where the program is running.
Is C# a case sensitive language?
Yes
What is the base index of arrays in C#
Zero
What are the two kinds of errors in C#
Compile Time, Run Time
In C#, what is a compile time error?
An error that occurs when the solution(project/code?) is being compiled.
In C#, what is a run time error?
A runtime error is a program error that occurs while the program is running.
In C#, what happens when a run time error is unhandled?
The CLR will shut down the application so it can not continue.
In a C# console app, where can I pass arguments for the debugger?
In the project properties, Debug tab, Command line arguments.
In Visual Studio, what is the autos debugging window for?
Show variables used around the current breakpoint.
What does it mean to say that C# is a typed language?
You have to have a type for every variable that you define.
In C# how do you name variables inside a method.
Starts with lower case letter. Each new word in the variable starts with an upper case letter.
In C# how do you name methods and classes?
Starts with an upper case letter.
What is in a class definition?
Starts with class keyword and name of the class. Everything inside is a class member.
What is a class State member
A class member that holds data
What is a class Behavior member
Members that do work. Methods is an example.
A field
Holds state for the class. It’s a class member. Field naming collection is lower case.
What does initializing an object do.
Reserves memory and give you a pointer to the memory?
Will C# accept an int as a float for a parameter typed as a float?
Yes
Will C# automatically accept a double as a float for a parameter typed as a float?
No.
How can you get C# to accept a double as a float?
Type an f at the end. Example 89.5f