Current location - Training Enrollment Network - Books and materials - Write a book.
Write a book.
Public books {

Private string title; //Book title

Private int pageNum// page

Private string type; //Book type

String title (int pagenum) (

this.title = title

this . setpagenum(pageNum);

This.type = " computer

}

Public book (string title, int pageNum, string type) (

this.title = title

this . setpagenum(pageNum);

this.type = type

}

Public string getTitle() {

Return the title;

}

Public void setTitle {

this.title = title

}

public int getPageNum() {

Return pageNum

}

public void setPageNum(int pageNum){

if(pageNum & lt; 200) {

System.out.println ("The number of pages cannot be less than 200!" );

this.pageNum = 200

} Otherwise {

this.pageNum = pageNum

}

}

Public string getType() {

Return type;

}

Public void setType (string type)

this.type = type

}

Public void details () {

System. out.println ("title:"+title+",page number:"+pagenum);

}

}