关于错误:The type Date is ambiguous 可能的原因之一
来源:互联网 发布:尼古丁 贴片 危害 知乎 编辑:程序博客网 时间:2024/06/16 01:05
The type Date is ambiguous ,意思是“Date类型不明确”,其实是因为冲突造成的。
如果你在自己的同一个文件里面即引入了java.sql.* 又引入了java.util.*,那么就会造成这样的冲突,因为这两个包里面都有Date类型,编译器不知道是哪一个。
解决方法一:
修改java.sql.*为java.sql.具体的类型。比如修改java.sql.*为java.sql.Connection,引入你要用的那几个就足够了。
这样避免了java.sql.Date的引入,不会造成冲突。
解决方法二:
在调用引起冲突的地方,指明用的是哪个包里面的Date。具体地说就是修改Date为java.util.Date或者java.sql.Date。
阅读全文
0 0
- 关于错误:The type Date is ambiguous 可能的原因之一
- 关于错误:'str' object is not callable可能的原因之一
- 关于ORACLE可能引起数字类型错误的原因之一
- The hierarchy of the type EditLocationAction is inconsistent 错误原因之一
- method is ambiguous for the type
- method is ambiguous for the type
- The method list(String, Object[]) is ambiguous for the type BaseHibernateDao<M,PK>错误解决方法
- android中关于No enclosing instance of the type Alarm0 is accessible in scope此类错误的原因
- 关于adb server is out of date的可能原因及解决办法
- 关于"The parameter list is too long"错误的原因
- 【.NET】 Unable to load the CLR 错误可能的原因之一
- The method find(String, Object[]) is ambiguous for the type
- 关于Reference to 'xxxxx' is ambiguous 错误
- 关于错误: 'encoding' is an invalid keyword argument for this function的错误原因之一
- 死递归:“段错误”产生的可能原因之一
- servlet web.xml配置好以后还会出现 the requested resource is not available错误的可能原因
- The method assertEquals(Object, Object) is ambiguous for the type Assert解决办法
- The method execute(Void[]) is ambiguous for the type new AsyncTask<Void,Void,Void>(){}
- response导出html到word
- python代码结构(第四章)
- linux学习—oracle导入数据库报唯一约束错误
- Android中获取SD卡下的图片资源
- iOS-企业级开发者账号发布流程
- 关于错误:The type Date is ambiguous 可能的原因之一
- HTML/CSS 学习笔记(一)
- 内核驱动上报EV_LED事件失败原因分析
- 使用structs2的时候进入action 不能赋值的错误
- 版本控制入门
- java wait()和sleep()的区别
- 对象权限+授予对象权限
- git 上传项目时提示Permission denied (publickey).的解决
- 微信小程序开发:各种页面特效集合(持续更新)