java - Why am I getting NullPointerException when running this code? -
Why I'm having a NullPointerException while running this code, I've seen what it is and still not okay Understanding this; help please? When running the code, using the variable Try the following: It will still check if it is in the letter Import java.util.Scanner; Public class test {public static zero main (string [] args) {scanner sc = new scanner (System.in); Println (); String user = sc.nextLine (); Four [] pass = system.console (). ReadPassword (); Println (passed); Char c = sc.next () Fourat (0); Println (c); Char d = sc.findInLine ("a"). Chart (0); Println (d); Char b = sc.next (). Fourat (0); Println (b); Println (user); }}
char b is running fine up to the last two rows, the error output output is as follows:
import java.util.Scanner; Public class test {public static zero main (string [] args) {scanner sc = new scanner (System.in); Println (); String user = sc.nextLine (); Four [] pass = system.console (). ReadPassword (); Println (passed); Char c = sc.next () Fourat (0); Println (c); String d = sc.next (); Bullion included; If (d.contains ("a")) {root = true; } Other (Contained = false;} System.out.println (d); System.out.println (containing "one included?"); Char b = sc.next (). Fourat (0); Println (b) ); Println (user);}}
a string though back to
true Or
false .
Comments
Post a Comment