Why won't this compile correctly? I added the main method line in an attempt to test it, but I get a lot of errors, saying the private constructors are illegal starts of expressions, as well as the public ones, in addition to saying they aren't statements. It's also asking me to add semicolons in places I didn't think were necessary due to them being the beginning of a method. I don't expect anyone to retype the code for me but can someone at least point me in the right direction and tell me where I'm going wrong?
import java.util.Arrays
public class Book{
public static void main (String[] args) {
private String title;
private String authors[];
public Book() {
title = "Test";
authors = null;
}
public Book(String title, String[] authors) {
this.title = title;
this.authors = authors;
}
public String getterTitle() {
return title;
}
public void setterTitle(String title) {
this.title = title;
}
public String[] getterAuthors() {
return authors;
}
public void setterAuthors(String[] authors) {
this.authors = authors;
}
public String bookToString() {
return "" + getterTitle() + " by " + getterAuthors() + "";
}
}