Search:

Type: Posts; User: bbr201

Search: Search took 0.07 seconds.

  1. Replies
    6
    Views
    2,895

    Re: problem in java.lang.NullPointerException

    Here are some examples of how you might use it:



    class A{
    int value;
    public A(int value){
    this.value = value;
    }
    }
  2. Replies
    6
    Views
    2,895

    Re: problem in java.lang.NullPointerException

    If you insist on designing it the way you are, I guess the quickest and simplest fix would be something like this:


    public static void main(String[] args) {
    Book b=new Book();

    b.first=new...
  3. Replies
    6
    Views
    2,895

    Re: problem in java.lang.NullPointerException

    Just from a quick glance, it looks like the Book class' private Chapter reference variables never actually point to anything. They are initialized to null in the constructor and they never point to...
Results 1 to 3 of 3