C# Flashcards
What is an IDE
An Integrated development environment
A software, that helps us develop with C#
How do you declare an Integer variable? What kind of integer values are there?
Using int
and assigning a number value
1) sbyte, holds values from -128 - 127
2) short, values from -32767 to 32767
3) int, values from -2,147,483,648 to 2,143,482,647
4) long, from every other number
5) float, allows decimals and a range of 7 digit precision (used in graphics libraries)
6) double for 15 digit precision (used for real world values)
7) decimal for 28 digit precision. (mainly used in financial applications)
YOU SHOULD USE THE DATA TYPE THAT CAN FIT THE VALUE.
How do you declare a boolean?
using bool
can only hold true/false values
What are the string data types?
1) char, can only store one letter
2) string, allows multiple letters and unicodes
can you divide two different data types?
int / (float/double/decimal)?
No, you are not able to divide the two different data types. You need to use casting
What are the primitive data types?
Integer and Booleans
Strings are a Class, but it is still considered a data type
What is a stateful method? What is a stateless method?
1) Stateful method is a instance method, it is a method that must have access to the estate of the application to work properly.
2) A Stateless method is a static method, this method can work properly without having to access the applications state. for example Console.WriteLine( )
What is state?
In computing, state describes the condition of the execution environment at a specific moment at time. As your code executes line by line, values are stored in variables. The current state of the application is the collection of all values stored in memory.
What is a void method? What is the opposite of a void?
A void method is a function that doesnt return a value. It is designed to complete their function, and end “quietly”.
The opposite of a void method is an operation
How are parameters for methods defined?
They are defined using a data type. We can’t pass values of a different data type as input parameters and expect the method to work. Instead, the C# compiler will catch a mistake and force a code modification before it compiles and runs it.
What is an overloaded method?
An overloaded method is defined with multiple method They provide different ways to call the method or provide different types of data.