Common Compile Time and Runtime Error Messages And What They Mean ===== incompatible type ===== The variable on the left side of the assignment operator (=) and the value on the right side have different types. For example, String str = 5; The variable on the left is of type String and the variable on the right is of type int. You cannont convert one to the other. ===== cannot find symbol -- method nextString ===== This method doesn't exist in the class. Either you mis-spelled the method or you are incorrectly remembering the name of the method. Go to the class API and look at the available methods ===== cannot find symbol -- method lastIndexOf ===== This method does exist and you have spelled it correctly. There is another syntax error somewhere on this line. For example, int position = lastIndexOf(' '); // incorrect -- you need to use the dot operator int position = name.lastIndexOf(' '); // correct ===== NullPointerException ===== An object was not initialized (and thus is null) and you used the dot operator to call a method An array was not initialized (and thus is null) and you used the bracket operator to index [] An object in an array is not initialized (i.e. array[i] is null) and you used the dot operator For example, Random rng; // declared but not initialized. rng holds the value null rng.nextInt(100); // you are calling the nextInt() method on a null variable