java 中的终极对象 Object
在java中所有的类都是从Object 继承过来的
Object对象 的方法
boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
int hashCode()
Returns a hash code value for the object.
java.lang.String toString()
Returns a string representation of the object.
getClass()
当某个对象是以Objiect类型来引用的时候,java会把他当作Object的实例,你只能调用Object的方法
Object vampire =new Vampire();
byte i=1;
vampire.frighten(i);
出错:The method frighten(byte) is undefined for the type Object
任何从arrayList中取出的东西都会当成Object类型而不管它原来是什么。