constructordemo.cs

来自「vc的原码例子12 vc的原码例子12」· CS 代码 · 共 33 行

CS
33
字号
using System;

class clsBook
{
	public clsBook(string title, string author, string topic)
	{ 
		Title = title;
		Author = author;
		Topic = topic;	
	}

	public void ShowBook()
	{
		System.Console.WriteLine(Title);
		System.Console.WriteLine(Author);
		System.Console.WriteLine(Topic);
	}

	public string Title;
	public string Author;
	public string Topic;
};

class clsCreateClassInstance
{
	static void Main()
	{
		clsBook Book = new clsBook("Jamsa's C/C++/C# Programmer's Bible",
			"Jamsa", "C, C++, and C# programming");
		Book.ShowBook();
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?