/**
* Sample application using the simple text editor component that
* supports only one font.
* @author Timothy Prinzing
* @version 1.16 09/23/99
*/ package MyProject.theFirstApp;
class notepad extends JPanel {
final int MAX_NUM=1000;
final long rate=999;
String STR;
char theFirstcharacter;
public static void main(String[] args) {
try {
String vers = System.getProperty("java.version");
if (vers.compareTo("1.1.2") < 0) { ......}
}
private Component CreateToolbar() { ...... }
}
* Sample application using the simple text editor component that
* supports only one font.
* @author Timothy Prinzing
* @version 1.16 09/23/99
*/ package MyProject.theFirstApp;
class notepad extends JPanel {
final int MAX_NUM=1000;
final long rate=999;
String STR;
char theFirstcharacter;
public static void main(String[] args) {
try {
String vers = System.getProperty("java.version");
if (vers.compareTo("1.1.2") < 0) { ......}
}
private Component CreateToolbar() { ...... }
}
有try没catch。
等等
string STR 没有被初始化,不存在吧 ?
类名首字母大小
变量全部要小写
而且str 局部变量要对它初始化的
try{}catch(){}要捕获的
private Component CreateToolbar() { ...... }
上面这句是什么意思?内部类的话 怎么能有括号? 而且类也不能用private来修饰
2、类名
3、赋值语句 空格
4、try catch 成对
5、方法名
6、代码对齐方式找本规范 稍微看下