Пример #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);
 }
Пример #2
0
 static void PrintBook(Book bk)
 {
     Console.WriteLine("Book Infor:\nPrice={0},Tile={1},Author={2}",
        bk.Price, bk.Title, bk.Author);
 }
Пример #3
0
 static void ChangeBook(Book bk)
 {
     bk.Price = 1.01;
     bk.Title = "Spss";
     bk.Author = "John";
 }