Code
Static
- static
- Can be used without invoking an instance
- Stack Memory
new className()
- new Operator
- Create an object and call a constructor
- Heap Memory
Random
- Exist in System Namespace
- Random Constructor
- Use
new
keyword and the constructor to create Random type object
- Use
Next() Method
- Next(int minValue, int maxValue)
- minValue ~ maxValue-1
- Return Integer(n>=0)
- Next(int maxValue)
- 0 ~ maxValue-1
Type Casting
- String -> Int
- Convert.ToInt32(String string)
- If string is null, then 0
- enum -> int
- (Type)enumClass.enumObject
- Be Careful when you change type bigger to small
Console.ReadLine()
- Input string from console
Console.WriteLine()
- Print string on console