WItam robię kurs na javastart.pl i w pewnym momencie kursy natrafiłem na taki kod nic szczególnego tu nie ma gettery i settery ale nie rozumiem pewnego kawałka kodu, który nie widzę by był wyjaśniony o co w nim chodzi
package data;
import app.Library;
/**
* Created by szymonciamaga on 01/12/2016.
*/
public class Book {
private String title;
private String author;
private int relaseDate;
private int pages;
private String publisher;
private String isbn;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public int getRelaseDate() {
return relaseDate;
}
public void setRelaseDate(int relaseDate) {
this.relaseDate = relaseDate;
}
public int getPages() {
return pages;
}
public void setPages(int pages) {
this.pages = pages;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public Book(String title, String author, int relaseDate, int pages, String publisher, String isbn) {
this.title = title;
this.author = author;
this.relaseDate = relaseDate;
this.pages = pages;
this.publisher = publisher;
this.isbn = isbn;
}
public Book(Book book) {
this(book.getTitle(), book.getAuthor(), book.getRelaseDate(), book.getPages(), book
.getPublisher(), book.getIsbn());
}
public void printInfo() {
String info = getTitle() + "; " + getAuthor() + "; " + getRelaseDate() + "; " + getPages()
+ "; " + getPublisher() + "; " + getIsbn();
System.out.println(info);
}
}
a Tu kawałek kodu którego nie rozumiem.
public Book(Book book) {
this(book.getTitle(), book.getAuthor(), book.getRelaseDate(), book.getPages(), book
.getPublisher(), book.getIsbn());
}