Question: Why is it saying I am referencing a variable that is null? I did import javax.swing.JOptionPane; so I don't know what is wrong. Run Code

Why is it saying I am referencing a variable that is null? I did import javax.swing.JOptionPane; so I don't know what is wrong.

Why is it saying I am referencing a variable that is null?

Run Code I STOP public void startGame) { System.out.println("Welcome!"); JOptionPane jp new JOptionPane(); Object[] starting = {50, 100, 250, 500, 1000}; Object smoney = (JOptionPane.showInputDialog(null, "How much money do you have?", "Select a starting money", JOptionPane. QUESTION_MESSAGE, null, starting, starting[0])); String stringsMoney = smoney.toString(); double bankroll = Double.parseDouble(stringsMoney); /*System.out.println("What is your starting money? "); double bankroll = sc.nextDouble();*/ while(bankroll(SunFontManager.ja at sun.awt. FcFontManager.(FcFontManager.java at sun.awt.X11Font Manager.(x11FontManager.jav at sun.reflect.NativeConstructorAccessorImpl.newIn: at sun.reflect.NativeConstructorAccessorImpl.newIn: at sun.reflect.DelegatingConstructorAccessorImpl.ne at java.lang.reflect.Constructor.newInstance(Consti player = new Player (bankroll); startRound(); } Errors: Dealer.java: Line 30: You appear to be referencing a variable that is null

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!