当前位置:网站首页>Object class - the father of ten thousand classes
Object class - the father of ten thousand classes
2022-06-29 11:42:00 【Hard work boy】
Object Class is a special class , Is the parent of all classes .
Because of this relationship ,Object Generic methods in classes ( function ) Can be used by subclasses .
public final native Class<?> getClass()
//native Method , Used to return the current runtime object Class object , Used final Keyword modification , Therefore, subclasses are not allowed to override .
public native int hashCode()
//native Method , Hash code used to return the object , It is mainly used in hash table , such as JDK Medium HashMap.
public boolean equals(Object obj)
// For comparison 2 Whether the memory addresses of objects are equal ,String Class to override the method, and the user compares the string values for equality .
protected native Object clone() throws CloneNotSupportedException
//naitive Method , Used to create and return a copy of the current object . In general , For any object x, expression x.clone() != x by true,x.clone().getClass() == x.getClass() by true.Object It didn't come true Cloneable Interface , So don't rewrite clone Method and make the call CloneNotSupportedException abnormal .
public String toString()
// Returns the name of the class @ Instance's hash code 16 Base string . Suggest Object All subclasses override this method .
public final native void notify()
//native Method , And it can't be rewritten . Wake up a thread waiting on this object monitor ( Monitor is equivalent to the concept of lock ). If there are multiple threads waiting, only one of them will wake up .
public final native void notifyAll()
//native Method , And it can't be rewritten . Follow notify equally , The only difference is that it wakes all threads waiting on this object monitor , Not a thread .
public final native void wait(long timeout) throws InterruptedException
//native Method , And it can't be rewritten . Pause thread execution . Be careful :sleep Method does not release lock , and wait Method releases the lock .timeout It's waiting time .
public final void wait(long timeout, int nanos) throws InterruptedException
// More nanos Parameters , This parameter represents the extra time ( In nanoseconds , The scope is 0-999999). So the overtime time needs to be added nanos millisecond .
public final void wait() throws InterruptedException
// Just like before 2 individual wait The method is the same , It's just that the method has been waiting for , There's no concept of overtime
protected void finalize() throws Throwable {
}
// The action triggered when an instance is collected by the garbage collector
边栏推荐
- 专访 SUSS NiFT 负责人:Web3 的未来离不开“人人为我,我为人人”的治理
- 【文献翻译】Concealed Object Detection(伪装目标检测)
- 中科方德技术专家直播:如何基于 OpenStack、Ceph 构建私有云平台? | 第 27 期
- (JS) array flat
- Babbitt | yuancosmos daily must read: HTC announced the launch of the first yuancosmos mobile phone, which costs about 2700 yuan. What are the new ways to play
- ESP8266简介:三种编程方式「建议收藏」
- Oracle扩充分布式云端服务 为更多客户带来全面公有云服务
- Today in history: musk was born; Microsoft launches office 365; The inventor of Chua's circuit was born
- Data analysis method and Thinking: funnel analysis
- Qt学习11 Qt 中的字符串类
猜你喜欢

Modbustcp protocol network learning single channel infrared module (double-layer board)
![Leetcode 535 encryption and decryption of tinyurl [map] the leetcode road of heroding](/img/76/709bbbbd8eb01f32683a96c4abddb9.png)
Leetcode 535 encryption and decryption of tinyurl [map] the leetcode road of heroding

Pipeline aggregations pipeline aggregations - parent-2

Evaluation of IP location query interface Ⅱ

Nature | biosynthetic potential of global marine microbiome

【每日3题(3)】重新格式化电话号码

Qt学习02 GUI程序实例分析

What are the main factors that affect the heat dissipation of LED packaging?

Modbustcp protocol WiFi wireless learning single channel infrared module (small shell version)

Bs-gx-017 online examination management system based on SSM
随机推荐
Follow Me Study HCIE-Big Data-Data Mining 第一章 数据挖掘介绍 模块二
Qt学习09 计算器界面代码重构
[3 questions per day (2)] minimum operand for generating alternate binary strings
深入理解 volatile 关键字
分布式缓存之Memcached
(JS) imitate the indexof method to find the position of a character in the string
Nature | 全球海洋微生物组的生物合成潜力
(JS) pure function in array
【高并发】2.8万字的Callable和Future面试知识点总结,看完我直接面进了字节跳动,原谅我有点飘了(中)
MMdet中的Resnet源码解读+Ghost模块
行业分析| 快对讲,楼宇对讲
Leetcode 535 encryption and decryption of tinyurl [map] the leetcode road of heroding
What are the pop, push, unshift, and shift of the (JS) array?
Qt学习08 启航!第一个应用实例
Pipeline aggregations管道聚合- parent-2
重建中国科研自信——2022最新自然指数排行榜(Nature Index 2022 )公布,中国的研究产出增幅最大...
(JS) array methods: slice and slice
ruoyi框架中添加sharding sphere5.0.0分表(通过spi添加自定义分表策略)
Interview questions of Tencent automation software test of CSDN salary increase secret script (including answers)
Bs-gx-017 online examination management system based on SSM