抽象类可以被实例化吗?

vintager4 2005-12-06 10:13:10
看到一条语句:Canlendar cl=Canlendar.getInstance();
Canlendar是一个抽象类,不能用new来实例化,难道可以用方法来实例化吗?真是不明白
...全文
266 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
vintager4 2005-12-06
  • 打赏
  • 举报
回复
谢谢yqj2065,我明白了.
vintager4 2005-12-06
  • 打赏
  • 举报
回复
cl不仅仅是一个声明吧?它指向的是一个什么东西呢?
yqj2065 2005-12-06
  • 打赏
  • 举报
回复
class A extends AA{ }

abstract class AA{ }

AA aa = new A();
XqYuan 2005-12-06
  • 打赏
  • 举报
回复
抽象和实例好像是相反的吧
yqj2065 2005-12-06
  • 打赏
  • 举报
回复
of course can
decalared type and runtime type is not the same matter
treeroot 2005-12-06
  • 打赏
  • 举报
回复
of course can't
decalared type and runtime type is not the same matter

62,634

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧