例如
public class mytest {
public static void main(String[] args)
{
problem test=new problem();
System.out.println(test.getTime());
}
class problem
{
private Date now;
public problem()
{
Date /*就是这里!*/ now=new Date();
}
public Date getTime()
{
return now;
}
}
|
|