Getter-Setter method and Array List : <p>I have a class NewClass2 and a class with main method. Basically what I want to to is I wanna save a book title, release date, number of pages and the isbn number in an ArrayList and then print the Info.</p>

<pre><code>public class NewClass2 {
    int pages;
    String released;
    String title;
    int isbn;



    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    public String getReleased() {
        return released;
    }

    public void setReleased(String released) {
        this.released = released;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getIsbn() {
        return isbn;
    }

    public void setIsbn(int isbn) {
        this.isbn = isbn;
    }

    public NewClass2(int pages, String released, String title, int isbn) {
        this.pages = pages;
        this.released = released;
        this.title = title;
        this.isbn = isbn;
    }

    public NewClass2() {
    }

    public void printInfo(){
        System.out.println("The book has "+pages+" pages and was released on "+released+" and is called "+title);
    }

}
</code></pre>

<p>And the main class:</p>

<pre><code>    public class mainClass {
    public static void main(String[] args){
        ArrayList&lt;NewClass2&gt; listTest = new ArrayList&lt;&gt;( );
        listTest.add(new NewClass2( 200,"Book 1", "8.9.14",2222) );
        listTest.add(new NewClass2( 200,"Book 2", "1.2.04",5555) );
        listTest.add(new NewClass2( 200,"Book 3", "5.4.06",6666) );
        listTest.add(new NewClass2( 200,"Book 4", "7.4.13",7777) );
        listTest.add(new NewClass2( 200,"Book 5", "2.2.03",8888) );

        NewClass2 book = new NewClass2(listTest);

        book.printInfo();

    }
}
</code></pre>

<p>The IDE tells me that </p>

<pre><code>NewClass2 book = new NewClass2(listTest);
</code></pre>

<p>is wrong but why? and how to i fix it??</p>
