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?

Why do firms need to invest in net working capital?

JAD Advantages and Disadvantages