📄 constructordemo.cs
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -