understand the program's logic
<p>I want to know why we can't write method in method in java and Why will the code not execute </p>

<pre><code>public class Quiz{

    public static void main(String[] args) {
        Book b = new Book(18);
        Book c = new Book(10);
        c = compare(c, b);
    }

    public static Book compare(Book k, Book m) {
        k.x = 10;
        k = null;
        m.x = 3;
        return m;
    }

    class Book {

        int x = 20;

        public Book(int x) {
            this.x = x;
        }
    }
}
</code></pre>
