哪位大神帮我瞧瞧,不知道那里有问题
import java.util.Date;public class Book
{
private String name;
private String id;
private String editor;
private String publisher;
private Date date;
private int page;
private double price;
private String BookName;
public Book()
{
this.name="java";
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name=name;
}
public String getEditor()
{
return editor;
}
public void setEditor(String editor)
{
this.editor=editor;
}
public String getId()
{
return id;
}
public void setId(String id)
{
this.id=id;
}
public String getPublisher()
{
return publisher;
}
public void setPublisher(String publisher)
{
this.publisher="清华大学";
}
public Date getDate()
{
return date;
}
public void setdate(Date date)
{
this.date=date;
}
public int getPage()
{
return page;
}
public void setPage(int page)
{
if(getPage()==200)
{
this.page=200;
}else
{
System.out.println("图书输入信息错误");
}
}
public double getPrice()
{
return price;
}
public void setPrice(double price)
{
this.price=200;
}
public class Test
{
public void main(String[] args)
{
Book book =new Book();
book.setName("java");
book.setId("23");
book.setEditor("徐琪");
book.setPublisher("清华大学");
book.setdate(new Date());
System.out.println("name"+book.getName());
System.out.println("id"+book.getId());
System.out.println("editor"+book.getEditor());
System.out.println("publisher"+book.getPublisher());
System.out.println("date"+book.getDate());
System.out.println("page"+book.getPage());
System.out.println("price"+book.getPrice());
}
}
}
不知道哪里有问题,就是运行说找不到主方法[/color][/color]