1. C#的数据类型
- 基本数据类型
- bool
- char
- byte
- short
- int
- float
- double
- long
- 引用类型
- string
- object
- class
- interface
- 数组
- 可空类型
- ? eg: int?
2. C#的类,属性,方法
和Java
语言是一样的
var person = new Person();
// 类
class Person
{
// 属性
public int Id { get; set; }
public string? Name { get; set; }
// 方法
public string? GetValue(int id, string name) {
this.Id = id;
this.Name = name;
return this.Id + this.Name;
}
}