Java 出现cannot be resolved to a type

Posted 人,唯一剥夺不了的,只有知识

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java 出现cannot be resolved to a type相关的知识,希望对你有一定的参考价值。

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)

以上是关于Java 出现cannot be resolved to a type的主要内容,如果未能解决你的问题,请参考以下文章

Java出现The import javax.servlet cannot be resolved 的解决方法

jsp页面出现“String cannot be resolved to a type”错误解决办法

the import java.util.* cannot be resolve,怎么解决

Eclipse的java代码出错:The import org.apache cannot be resolved

Eclipse的java代码出错:The import org.apache cannot be resolved

Java导入项目时,出现The project cannot be built until build path errors are resolved错误解决方法