좋아요. 책이라는 클래스를 만들어야하는데 저자, 제목 및 날짜가 있어야하며 마지막에 display라는 메서드를 추가해야합니다.)로 제목과 저자를 출력합니다. 나는 올바른 코드를 가지고 있다고 생각하지만 그것은 나에게 날짜 오류를주고있다?C에서 책 클래스를 만드는 데 문제가 있습니다.
namespace lab7_feador
{
class Program
{
static void Book(string[] args);
public class Book
{
public string Nick { get; set; }
public string James { get; set; }
public string Radar { get; set; }
public int 1989 { get; set; }
}
}
}
이것이 어떻게 되겠습니까?
또는 당신이 다음 날짜 시간 형식을 사용한다 날짜를 원한다면
네임 스페이스 lab7_feador이 {
class Program
{
static void Main(string[] args)
{
book;
book = title book ("Radars adventure");
Console.WriteLine(book.title());
book = Author ("Nick James");
Console.WriteLine(author.Describe());
Console.ReadLine();
}
}
class book
{
private string title;
public book(string title)
{
this.title = title;
}
public string Describe()
{
return "The name of this book is " + title;
}
public string Color
{
get { return title; }
set { title = value; }
}
}
}
날짜는 언제이고 오류 메시지는 무엇입니까? –
'public int 1989 {get; 세트; }'? 오, 소년 ... – LarsTech
미래에 항상 질문에 오류 메시지를 포함 시키십시오 ... 오류가 있다는 것을 단순히 알려주는 것은 도움이되지 않습니다. –