高手帮我改下JAVA程序!!!

[复制链接]
查看11 | 回复4 | 2008-9-19 11:58:51 | 显示全部楼层 |阅读模式
public class SimpleJavaProgram {
/* In the interests of simplicity, this program is under-documented */
public static void main(String[] args) {
int numericValue;
Scanner sc = new Scanner(System.in);
System.out.print("Enter a numeric value: ");
// See what we've got
if (numericVlaue > 0) {
System.out.println(numericValue + " is positive.");
} else if (numericValue0) {写错了是numericValue你还要赋初始值。Scanner sc = new Scanner(System.in); int numericValue = sc.nextInt();;你还有问题吗?不会的可以问。欢迎讨论Java问题~~...
回复

使用道具 举报

千问 | 2008-9-19 11:58:51 | 显示全部楼层
晕!变量错误你定义的是int numericValue在判断中写成numericVlaue if (numericVlaue > 0)...
回复

使用道具 举报

千问 | 2008-9-19 11:58:51 | 显示全部楼层
楼上说的对,在// See what we've got 后上加一句:numericValue = sc.nextInt();...
回复

使用道具 举报

千问 | 2008-9-19 11:58:51 | 显示全部楼层
我发现还是运行不了啊,我想知道这个要怎么运行的啊...
回复

使用道具 举报

千问 | 2008-9-19 11:58:51 | 显示全部楼层
public class SimpleJavaProgram { /* In the interests of simplicity, this program is under-documented */ public static void main(String[] args) { int numericValue; Scanner s...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行