C#
class Book
{
// class fields
protected string Name;
protected int Price;
// class constructor with parameters
public Book(string name, int price)
{
Name = name;
Price = price;
}
}
C#
// create a class object Book
Book book2 = new Book("The Three Musketeers", 30);
// the class constructor is called Book(string, int)