View difference between Paste ID: hRSVFLzS and ZnpW8QCk
SHOW: | | - or go back to the newest paste.
1
class Book
2
{
3
    // The fields.
4
    private String author;
5
    private String title;
6
    private int pages;
7
    private String refNumber;
8
9
    /**
10
     * Set the author and title fields when this object
11
     * is constructed.
12
     */
13
    public Book(String bookAuthor, String bookTitle, int amountPages, String setRef)
14
    {
15
16-
        if(setRef == null)
16+
17-
        {
17+
18
            title = bookTitle;
19
            pages = amountPages;
20
        
21
    }
22-
        }
22+
23-
        if(setRef!= null)
23+
public Book(String bookAuthor, String bookTitle, int amountPages)
24-
        {
24+
25
            refNumber = "";
26
            author = bookAuthor;
27
            title = bookTitle;
28
            pages = amountPages;
29-
        }
29+
      
30
    }
31
    
32
    public String returnAuthor()
33
    {
34
        return author;
35
    }
36
    
37
    public int getPages()
38
    {
39
        return pages;
40
    }
41
    
42
    public String returnTitle()
43
    {
44
        return title;
45
    }
46
    
47
    public void printAuthor()
48
    {
49
        System.out.println(author);
50
    }
51
    
52
    public void printTitle()
53
    {
54
        System.out.println(title);
55
    }
56
    
57
    public void printDetails()
58
    {
59
        System.out.println("Titel : " + title);
60
        System.out.println("Auteur : " + author);
61
        System.out.println("Aantal pagina's : " + pages);