在我的代码中请帮助我不断获取:线程“main”java.lang.NullPointerException中的异常

时间:2015-09-18 02:40:36

标签: java

package Josh_the_bot;

/**
 *
 * @author Jarvis-Main
 */
import java.util.*;
import javax.swing.JOptionPane;
public class Josh_the_bot {

    /**
     * @param args the command line arguments
     * @throws java.lang.InterruptedException
     */
    public static void main(String[] args) throws InterruptedException {
        // TODO code application logic here 
        Scanner namea = new Scanner (System.in);
        int temperature = 0 ;
        String theName;
        theName = "Josh";
        String name = JOptionPane.showInputDialog("Hello What Is Your Name?");
        int namez = Integer.getInteger(name);
        String namereply = JOptionPane.showInputDialog( "O hello" + namez );
        int lel = Integer.parseInt(namereply);

我收到此错误

Exception in thread "main" java.lang.NullPointerException
at Josh_the_bot.Josh_the_bot.main(Josh_the_bot.java:27)

Java结果:1

0 个答案:

没有答案