package helloworld;
import java.lang.*;
import java.io.*;/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Hello {
public Hello() {
super();
}
public String readname() {
int ch;
String getname = "";
boolean ok = false;
System.out.println("请输入您的姓名:");
while (!ok) {
try {
ch = System.in.read();
if (ch < 0 | (char) ch == '\n')
ok = true;
else if ((char) ch != '\r')
getname = getname + (char) ch;
} catch (IOException e) {
ok = true;
}
}
public static void main(String[] args) {
String name;
Hello hello = new Hello();
name = myHello.readname();
System.out.printin("欢迎您," + neme + "!");
System.out.printin("zhuninchenggong!");
}
}想知道在最后怎么编译总是过不了 似乎没错 郁闷了 在JBUILDER2006上编译的 求助 谢谢了
编译错误提示为:"Hello.java": '}' expected at line 44, column 6 怎么理解 编译器没汉化的 郁闷 谢谢 您的解答!!
import java.lang.*;
import java.io.*;/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Hello {
public Hello() {
super();
}
public String readname() {
int ch;
String getname = "";
boolean ok = false;
System.out.println("请输入您的姓名:");
while (!ok) {
try {
ch = System.in.read();
if (ch < 0 | (char) ch == '\n')
ok = true;
else if ((char) ch != '\r')
getname = getname + (char) ch;
} catch (IOException e) {
ok = true;
}
}
public static void main(String[] args) {
String name;
Hello hello = new Hello();
name = myHello.readname();
System.out.printin("欢迎您," + neme + "!");
System.out.printin("zhuninchenggong!");
}
}想知道在最后怎么编译总是过不了 似乎没错 郁闷了 在JBUILDER2006上编译的 求助 谢谢了
编译错误提示为:"Hello.java": '}' expected at line 44, column 6 怎么理解 编译器没汉化的 郁闷 谢谢 您的解答!!
System.out.printin("zhuninchenggong!");
是println不是printin
Application main class is not configured
运行的时候总是出现这个问题 这是怎么回事??
name = myHello.readname();
System.out.printin("欢迎您," + neme + "!");
myHello 应该是hello吧
neme 应该是name吧
主类不是main class就可以了吗?? 还要 怎么去生成 ?? 谢谢解答!
public Hello() {
super();
}
public String readname() {
int ch;
String getname = "";
boolean ok = false;
System.out.println("请输入您的姓名:");
while (!ok) {
try {
ch = System.in.read();
if (ch < 0 | (char) ch == '\n')
ok = true;
else if ((char) ch != '\r')
getname = getname + (char) ch;
} catch (IOException e) {
ok = true;
}
}
}//却个大括号
public static void main(String[] args) {
String name;
Hello hello = new Hello();
name = myHello.readname();
System.out.printin("欢迎您," + neme + "!");
System.out.printin("zhuninchenggong!");
}
}