C# Basics (Teamtreehouse) Flashcards
What is a return type?
The type of information a method returns.
What are the four P’s of Problem Solving?
Four P’s of Problem Solving
Prepare - This is where we understand and diagnose the problem.
Plan - This is where we organize everything before acting.
Perform - We simply put the plan into action.
Perfect - This is when we check to see if what we made has solved the problem and consider how to make it better. We can use the Four P’s again to make improvements.
What signifies the end of statement of code?
Semicolon signifies the end of statement of code.
What is a compiler?
A compiler is a program that converts human readable code into machine readable code to be executed by a computer.
What is camel casing?
A convention in which the first letter is lowercase and each subsequent concatenated word is capitalized.
What is pascal casing?
A convention in which the first letter is uppercase and each subsequent concatenated word is capitalized.
What is the name of the namespace in the following method call: Adobe.Illustrator.Canvas.Paint();?
Adobe.Illustrator
What is the name of the class in the following method call: StackOverflow.Controllers.CommentController.Details();?
CommentController
What is the name of the method in the following method call: Apple.IPhone.Dialer.Dial(string phoneNumber);?
Dial
What does void return type represent in method signature?
Void return type specifies that the method doesn’t return a value.
What are character escape sequence in C#?
C# defines the following character escape sequences:
' – single quote, needed for character literals
" – double quote, needed for string literals
\ – backslash
\0 – Unicode character 0
\a – Alert (character 7)
\b – Backspace (character 8)
\f – Form feed (character 12)
\n – New line (character 10)
\r – Carriage return (character 13)
\t – Horizontal tab (character 9)
\v – Vertical quote (character 11)
\uxxxx – Unicode escape sequence for character with hex value xxxx
\xn[n][n][n] – Unicode escape sequence for character with hex value nnnn (variable length version of \uxxxx)
\Uxxxxxxxx – Unicode escape sequence for character with hex value xxxxxxxx (for generating surrogates)
Of these, \a, \f, \v, \x and \U are rarely used in my experience.
How do you read a call stack trace?
From the bottom up.
List possible combinations in mixing integers and doubles in arithmetic operations and their resulting type.
Mixing integers and doubles in arithmetic operations:
int double double
int int int (beware of truncation!)
double int double
What is casting? Provide example.
Casting is explicit conversion from one data type to another. Double > Int, BaseClass > Derived Class. For example: int x = (int)(5 / 2.5);
What is code refactoring?
When you change the code of program without changing apparent functionality.