C# Flashcards

1
Q

What is an IDE

A

An Integrated development environment

A software, that helps us develop with C#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you declare an Integer variable? What kind of integer values are there?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you declare a boolean?

A

using bool

can only hold true/false values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the string data types?

A

1) char, can only store one letter

2) string, allows multiple letters and unicodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

can you divide two different data types?

int / (float/double/decimal)?

A

No, you are not able to divide the two different data types. You need to use casting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the primitive data types?

A

Integer and Booleans

Strings are a Class, but it is still considered a data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a stateful method? What is a stateless method?

A

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( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is state?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a void method? What is the opposite of a void?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How are parameters for methods defined?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is an overloaded method?

A

An overloaded method is defined with multiple method They provide different ways to call the method or provide different types of data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly