0
我得到了一些錯誤說法:簡單的繼承問題
「名稱‘標題’不存在於它的當前背景下」 「名稱‘作者’不存在於它的當前背景下」 「這個名字「流派」不存在於它的當前背景下」 ‘名稱‘頁’不存在於它的當前語境’
using System;
using System.Collections.Generic;
using System.Text;
namespace ReadingMaterials
{
class Program
{
static void Main(string[] args)
{
}
public class Basic
{
protected string Title;
protected string Author;
protected string Genre;
protected int Pages;
public Basic(string title, string author, string genre, int pages)
{
Title = title;
Author = author;
Pages = pages;
Genre = genre;
}
public int PageCount
{
get { return Pages; }
set { Pages = value; }
}
public string GenreType
{
get { return Genre; }
set { Genre = value; }
}
public string AuthorType
{
get { return Author; }
set { Author = value; }
}
public string TitleName
{
get { return Title; }
set { Title = value; }
}
}
public class Book : Basic
{
protected bool Hardcover;
public Book(bool hardcover)
: base(title, author, genre, pages)
{
Hardcover = hardcover;
}
public bool IsHardcover
{
get { return Hardcover; }
set { Hardcover = value; }
}
}
}
}
缺少什麼我在這裏?提前致謝。
謝謝先生!這工作=] – Stradigos 2010-03-16 04:20:05