Explain what a NullPointerException is and how it can arise.

Explain what a NullPointerException is and how it can arise.

Answer:  A NullPointerException is an exception that indicates that an operation was attempted on some object that is equal to null.  For instance, ChessPiece c; declares c to refer to a ChessPiece, but c has not yet been instantiated, so any message passed to c at this point will cause a NullPointerException.

Comments

Popular posts from this blog

What is JAD and how are users involved? What are advantages and disadvantages of JAD?

JAD Advantages and Disadvantages

What are the three dimensions to business problems? Give an example of each.