java编译时候错误显示找不到符号我是新手 ..求解答
C:\Users\Administrator\Desktop>javacHelloWorld.javaHelloWorld.java:11:错误:找不到符号System....
C:\Users\Administrator\Desktop>javac HelloWorld.java
HelloWorld.java:11: 错误: 找不到符号
System.out.printlh("HelloWorld");
^
符号: 方法 printlh(String)
位置: 类型为PrintStream的变量 out
1 个错误 展开
HelloWorld.java:11: 错误: 找不到符号
System.out.printlh("HelloWorld");
^
符号: 方法 printlh(String)
位置: 类型为PrintStream的变量 out
1 个错误 展开
2个回答
展开全部
public class clock
{
public static void main(String args[])
{
ClockView cv = new ClockView();
cv.setVisible(true);//这里setVisible错了
try {
for (;;) {
cv.refreshTimeDisply();//这里refreshTimeDisply错了
Thread.sleep(500);
}
} catch (Exception e)
{
System.out.println("Error:" + e);
}
}
}
class ClockView extends javax.swing.JFrame
{
private javax.swing.JLabel tLabel = new javax.swing.JLabel();
ClockView()
{
this
.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
this.setSize(95, 45);
this.getContentPane().add(tLabel);
this.refreshTimeDisply(); //这个单词错了
}
protected String getDigitsAsString(int i)
{
String str = Integer.toString(i);
if (i < 10)
str = "0" + str;
return str;
}
public void refreshTimeDisply() {
Timestamp t = new Timestamp();
t.fillTimes();
String display = getDigitsAsString(t.hrs) + ":"
+ getDigitsAsString(t.mins) + ":"
+ getDigitsAsString(t.secs); // 这个getDigitsAsString写错了
tLabel.setText(" " + display);
tLabel.repaint();
}
}
class Timestamp
{
int hrs, mins, secs;
void fillTimes() {
java.util.Calendar now ; //这个Calendar 错了
now = java.util.Calendar.getInstance() ;
hrs = now.get(java.util.Calendar.HOUR_OF_DAY);
mins = now.get(java.util.Calendar.MINUTE);
secs = now.get(java.util.Calendar.SECOND);
}
}
{
public static void main(String args[])
{
ClockView cv = new ClockView();
cv.setVisible(true);//这里setVisible错了
try {
for (;;) {
cv.refreshTimeDisply();//这里refreshTimeDisply错了
Thread.sleep(500);
}
} catch (Exception e)
{
System.out.println("Error:" + e);
}
}
}
class ClockView extends javax.swing.JFrame
{
private javax.swing.JLabel tLabel = new javax.swing.JLabel();
ClockView()
{
this
.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
this.setSize(95, 45);
this.getContentPane().add(tLabel);
this.refreshTimeDisply(); //这个单词错了
}
protected String getDigitsAsString(int i)
{
String str = Integer.toString(i);
if (i < 10)
str = "0" + str;
return str;
}
public void refreshTimeDisply() {
Timestamp t = new Timestamp();
t.fillTimes();
String display = getDigitsAsString(t.hrs) + ":"
+ getDigitsAsString(t.mins) + ":"
+ getDigitsAsString(t.secs); // 这个getDigitsAsString写错了
tLabel.setText(" " + display);
tLabel.repaint();
}
}
class Timestamp
{
int hrs, mins, secs;
void fillTimes() {
java.util.Calendar now ; //这个Calendar 错了
now = java.util.Calendar.getInstance() ;
hrs = now.get(java.util.Calendar.HOUR_OF_DAY);
mins = now.get(java.util.Calendar.MINUTE);
secs = now.get(java.util.Calendar.SECOND);
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询