//There are two other construction methods (one with parameters and one without parameters).
//There is a member method printBook () for outputting data. Set a test class test and output it.
Public books {
Private string author;
Private string title;
Private string number;
Private internal sales;
Public books () {
Public books (string author, string title, string number, internal sales) {
this.author = auther
this.title = title
this.num = num
This.sale = sales;
}
Public void printBook(){
system . out . println(" author:"+author+",title:" + title +",num:" + num +",sale:"+sale);
}
Public string getAuthor() {
Return the author;
}
Public void setAuthor {
This.author = author;
}
Public string getTitle() {
Return the title;
}
Public void setTitle {
this.title = title
}
Public string getNum() {
Quantity returned;
}
public void setNum(String num) {
this.num = num
}
public int getSale() {
Return sales;
}
public void setSale(int sale) {
This.sale = sales;
}
}
Test category:
Public static void main(String[] args) {
Book b = new book ("author", "title", "123456798",1000);
b . print book();
}
Extended data:
The console program is set to be compatible with DOS programs. The execution of this program is just like executing in a DOS window, without its own interface.
Intel's CPU has three working modes, real mode, protected mode and virtual mode. The real mode is 16 bits, and pure DOS can run in this mode. The protection mode is 32-bit, and WINDOWS works in this mode. In order to make WINDOWS working in 32-bit protection mode compatible with DOS programs in 16-bit real mode, a virtual mode is set up, which is the console program.
Baidu encyclopedia-console program