Can anyone help me identify the Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException on Line 65?

前端 未结 2 1857
半阙折子戏
半阙折子戏 2021-01-28 16:28

I keep getting a Run Time error that says I am having an Exception in thread \"AWT-EventQueue-0\" java.lang.NullPointerException it is saying a [line 65] but to me it just looks

相关标签:
2条回答
  • 2021-01-28 17:01

    Line 65 is this one:

    if (state.equals("Alabama"))
    

    If you look through the previous code, nothing has initialized state so its value will be null.

    0 讨论(0)
  • 2021-01-28 17:10

    The state is null when you try to invoke equals on it.

    0 讨论(0)
提交回复
热议问题