当前位置:网站首页>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
边栏推荐
- 申请uniapp离线打包时的AppKey
- mysql截取字符串去重,mysql 截取字符串 去重 拼接
- Hit the industry directly! The first model selection tool in the industry was launched by the flying propeller
- Go 单元测试入门实践
- 【每日3题(3)】重新格式化电话号码
- ES6 数组方法
- 海泰前沿技术|隐私计算技术在医疗数据保护中的应用
- When a technician becomes a CEO, what "bugs" should be modified?
- Week 12 experiment -- implementation of VGA protocol based on FPGA
- Live broadcast by technical experts from China Kuwait Fangde: how to build a private cloud platform based on openstack and CEPH| Issue 27
猜你喜欢

XML外部实体注入漏洞(一)

稳定币风险状况:USDT 和 USDC 安全吗?

斐波那锲数列与冒泡排序法在C语言中的用法

QT learning 09 calculator interface code reconstruction

TTL serial port learning infrared remote control module can be extended to network control

Qt学习01 GUI程序原理分析

Qt学习02 GUI程序实例分析

中国计算语言学大会、全国知识图谱与语义计算大会赛题火热进行中

Qt学习05 Qt Creator工程介绍

【文献翻译】Concealed Object Detection(伪装目标检测)
随机推荐
(JS) handwritten deep copy
X-FRAME-OPTIONS web page hijacking vulnerability
在日本的 IT 公司工作是怎样一番体验?
软件工程导论——第五章——总体设计
Xuetong denies that the theft of QQ number is related to it: it has been reported; IPhone 14 is ready for mass production: four models are launched simultaneously; Simple and elegant software has long
QT learning 09 calculator interface code reconstruction
Is it safe to open a stock account online
ruoyi框架中添加sharding sphere5.0.0分表(通过spi添加自定义分表策略)
Interview questions of Tencent automation software test of CSDN salary increase secret script (including answers)
合约量化交易系统玩法开发 (现成案例分析)
Oracle NetSuite 助力 TCM Bio,洞悉数据变化,让业务发展更灵活
重建中国科研自信——2022最新自然指数排行榜(Nature Index 2022 )公布,中国的研究产出增幅最大...
XML external entity injection vulnerability (I)
美创入选信通院“业务安全推进计划”首批成员单位
(JS) pure function in array
稳定币风险状况:USDT 和 USDC 安全吗?
STM32看门狗研究
Design and implementation of IDS
Bs-gx-018 student examination system based on SSM
二叉树递归与迭代