由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Re: 初级问题
相关主题
请问有没有generic的array看了zhaoce073大水忍不住说2句
Is it possible to get Class object for T from a generic class? (下列空档,是否可填)这道题该走什么路
what's inside an java object?A question about inheritance
[合集] 谁能解释一下这里的protected specifierWhy HttpServletRequest extends Object implements ServletRequest
请教一个动态cast的问题请教一个Queue实现的问题
Re: 如何在两个窗口之间通信?error: generic array creation
泛型问题Re: How to use abstract class?
abstract class 的简单例子Re: question
相关话题的讨论汇总
话题: childclass话题: object话题: class话题: varparent话题: extends
进入Java版参与讨论
1 (共1页)
w****r
发帖数: 2
1
Object is the base class in Java, each class in Java will inherit
Object even if you don't use 'extends Object', it's to say:
class A {...}
equals
class A extends Object{...}
you can get the assignment as you want,
class A {...}
class ChildClass extends A {...}
...
A varParent = ...;
ChildClass varChild = (ChildClass) varParent;
But pls note: the runtime type of varParent must be
ChildClass or ChildClass' subclass. otherwise you will
get runtime assignment exception.
1 (共1页)
进入Java版参与讨论
相关主题
Re: question请教一个动态cast的问题
Re: Why my url can not open a connection to my servlet in a web browseRe: 如何在两个窗口之间通信?
Java interview Question(31-50)泛型问题
Core Java2 Notes (4)abstract class 的简单例子
请问有没有generic的array看了zhaoce073大水忍不住说2句
Is it possible to get Class object for T from a generic class? (下列空档,是否可填)这道题该走什么路
what's inside an java object?A question about inheritance
[合集] 谁能解释一下这里的protected specifierWhy HttpServletRequest extends Object implements ServletRequest
相关话题的讨论汇总
话题: childclass话题: object话题: class话题: varparent话题: extends