Exemplo n.º 1
0
 static void Main(string[] args)
 {
     Book bk = new Book();//错误 Book bk;
     bk.Price = 10.01;
     bk.Title = "MatLab";
     bk.Author = "Tom";
     PrintBook(bk);
     ChangeBook(bk);
     PrintBook(bk);
 }
Exemplo n.º 2
0
 static void PrintBook(Book bk)
 {
     Console.WriteLine("Book Infor:\nPrice={0},Tile={1},Author={2}",
        bk.Price, bk.Title, bk.Author);
 }
Exemplo n.º 3
0
 static void ChangeBook(Book bk)
 {
     bk.Price = 1.01;
     bk.Title = "Spss";
     bk.Author = "John";
 }