package com.sysutil.util; /* thishi duo zhu */ // dan zhshi import com.sysutil.util.*; class Example { public static void main(String[] args) { DateTool datato = new DataTool(); String stdd = DateTool.getDateTime(); System.out.println(stdd); } }
DateTool datato = new DataTool();
日期类中所有成员方法都是static的。 new对象出现错误 :
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
DataTool cannot be resolved to a type
at com.sysutil.util.Example.main(Example.java:11)