class Book {

    private String title;
    private String author;

    Book() {
        this("unknown", "unknown");
    }
    
    Book(String title, String author) {
        this.title = title;
        this.author = author;
    }

    public  String getTitle() {         // getter method
        return ( title );
    }    
        
    public void setTitle(String str){   // setter method
        title = str;
    }
    
    public String getAuthor() {         // getter method
        return( author );
    }
    
    public void setAuthor(String str) { // setter method
        author = str;
    }

    public String toString() {
        return(" Title: " + title + "\nAuthor: " + author);
    }
         
}

class TestBook{
    public static void main(String[] args) {
        Book b1 = new Book();
        System.out.println(b1);
        
//      b1.title = "Java Programming Language";     // compile-error        
//      b1.author = "Ken Arnold and James Gosling"; // compile-error

        // must use accessor methods
        b1.setTitle("The Java Programming Language: Second Edition");
        b1.setAuthor("Ken Arnold and James Gosling");

//      System.out.println(b1.title, b1.author);    // compile-error
        
        System.out.println(" Title: " + b1.getTitle() );
        System.out.println("Author: " + b1.getAuthor() );

        
    }
}
