Hi i am very new to java and have come across this problem in my code. Will someone please explain to me why i am getting a null point exception and what one is? I have tried to find out what it means but i cannot find an explanation anywhere.
Thank you
class Main {
String s;
void initializeStuff() {
String s = "aaa";
}
void displayStuff() {
System.out.print("The length of '"+s+"' is: ");
System.out.print(s.length());
}
public static void main(String[] args) {
Main main = new Main();
main.initializeStuff();
main.displayStuff();
}
}