corejava2 3.7.1 的代码,,,,我郁闷,跟书上一样打进去,运行还是出错,,,
import javax.swing.*;
public class InputDialog
{
public static void main(String[] args)
{
String name=JOptionPane.showInputDialog("What is your name?");
String input=JOptionPane.showInputDialog("How old are you?");
int age=Integer.parseInt(input);
System.out.println("Hello,"+name+".Next year,you'll be"+(age+1));
System.exit(0);
}
}
我一个一个对着看,没有错啊, - -,运行的时候还是报错,,搞不懂了, 报的错~~~import javax.swing.*;
public class InputDialog
{
public static void main(String[] args)
{
String name=JOptionPane.showInputDialog("What is your name?");
String input=JOptionPane.showInputDialog("How old are you?");
int age=Integer.parseInt(input);
System.out.println("Hello,"+name+".Next year,you'll be"+(age+1));
System.exit(0);
}
}
import javax.swing.*;
public class InputDialog
{
public static void main(String[] args)
{
String name=JOptionPane.showInputDialog("What is your name?");
String input=JOptionPane.showInputDialog("How old are you?");
int age=Integer.parseInt(input);
System.out.println("Hello,"+name+".Next year,you'll be"+(age+1));
System.exit(0);
}
}
我一个一个对着看,没有错啊, - -,运行的时候还是报错,,搞不懂了, 报的错~~~import javax.swing.*;
public class InputDialog
{
public static void main(String[] args)
{
String name=JOptionPane.showInputDialog("What is your name?");
String input=JOptionPane.showInputDialog("How old are you?");
int age=Integer.parseInt(input);
System.out.println("Hello,"+name+".Next year,you'll be"+(age+1));
System.exit(0);
}
}
楼主【fantasyeva】截止到2008-07-18 11:12:35的历史汇总数据(不包括此帖):
发帖的总数量:6 发帖的总分数:95 每贴平均分数:15
回帖的总数量:27 得分贴总数量:4 回帖的得分率:14%
结贴的总数量:3 结贴的总分数:60
无满意结贴数:0 无满意结贴分:0
未结的帖子数:3 未结的总分数:35
结贴的百分比:50.00 % 结分的百分比:63.16 %
无满意结贴率:0.00 % 无满意结分率:0.00 %
楼主加油
InputDialog.java:1: 需要 "class" 或 "interface"
锘縤mport javax.swing.*;
^
1 错误就这样滴,,, = = 谢谢啦~~
运行结果:
Hello,bb.Next year,you'll be34
结果,不管是复制过去的代码还是打上去的,都会有个看不到非法字符,应该是 EmEdior 编码上出的错~~~
我试了下,把 import javax.swing.*; 提行了很多,,,出来的错,更无语, - ------------------------------------------------------
D:\>javac InputDialog.java
InputDialog.java:1: 警告:编码 GBK 的不可映射字符
锘?
^
InputDialog.java:1: 需要 "class" 或 "interface"
锘?
^
InputDialog.java:1: 非法字符: \65533
锘?
^
2 错误
1 警告D:\>
-------------------------------------------------------谁可以给我推荐一个好点的编辑器??? 看来 EmEdior 在支持JAVA上有点问题,而且这东西不能即时编译有点麻烦,,呵呵~
谢谢各位啦~~
EmEdior 也是一个文本编辑器,前两年很流行~ 最近就不知道,,,反正我现在一般用这个代替 notepad ,eclipse 装了个,但,,,新建 JAVA 的时候麻烦,还得建项目, - - ~
我想找个,写了代码后,能直接编译运行的~~ ^ ^
目前来说还不用到那么强大的功能.呵呵
运行时修改下主类就行,很方便的
我也很郁闷,有没有办法,解决这个问题,究竟EmEditor加入了什么东西