Docsity

Strings, Lecture Notes - Computer Science, Study notes of Introduction to Computers

Partial preview of the text

Download Strings, Lecture Notes - Computer Science and more Study notes Introduction to Computers in PDF only on Docsity!

1 of 13 Lesson: strings NullPointerException Look for every {.) on the line of code that caused the error. Something immediately to the left of one of those periods must have been the null value {instead of being the object you thought you had). Suppose you get a WNullPointerException on this line: if (grid.getImage (loc) equals ("frog.gif")) What must have been null? grid grid.getImage (loc)