源码如下: import java.awt.*;  
  import java.util.*;  
  import java.awt.event.*;   public class ThreeClocks extends Panel implements Runnable{   
         private int timee;   
         private Thread thd;   
             public ThreeClocks(int t){    
                  timee=t;    
                  thd=new Thread(this);    
                  thd.start();   
      }   
    public void run(){    
       while(thd!=null){     
            repaint();     
                try{       
                     thd.sleep(timee);     
               }catch(InterruptedException e){}    
            }   
        }
    public void paint(Graphics g){            Date now=new Date();  //"Date now = new Date();"中的“now”是什么语法含义。         g.drawString(now.getHours()+":"+now.getMinutes()+":"+now.getSeconds(),5,10);  
         }  
         public static void main(String args[]){   
             ThreeClocks Clock1,Clock2,Clock3;   
             Clock1=new ThreeClocks(1000);   
             Clock2=new ThreeClocks(5000);   
             Clock3=new ThreeClocks(10000);   
               Frame f=new Frame("Three Clocks running together");   
                   f.setSize(200,100);   
                   f.setVisible(true);   
                   f.addWindowListener(new WindowAdapter(){  
                       public void windowClosing(WindowEvent e){System.exit(1);}});   
                   f.setLayout(new GridLayout(1,3));   
                   f.add(Clock1);   
                   f.add(Clock2);  
                  f.add(Clock3);  
        } 
     }  

解决方案 »

  1.   

    now只是一个Date类型的变量,后面是创建的一个Date的对象.
    String now = new String("aa");
    跟这个类似
    只不过new Date();返回的Date是当前时间,所以起名为now
      

  2.   

    LZ,那个now换个中文名字也行,不信你试试。
      

  3.   

    楼主对JAVA的基本语法还是一知半解?
      

  4.   

    就是Date的一个特定“昵称”,就像“张三”是某个具体人名一样的道理。
      

  5.   

    那个一个Date类型的变量对象  可以随便取名的
      

  6.   

    您好,now是英文里现在的意思。
      

  7.   

    我是java初学者,java的书都那么厚,语法也不少,只能一边写程序一边熟悉语法了。