Java System类runFinalization()方法及示例

系统类runFinalization()方法 (System class runFinalization() method)

  • runFinalization() method is available in java.lang package.

    runFinalization()方法在java.lang包中可用。

  • runFinalization() method is used to run the finalize() methods of any object that are already in a queue for disposing of unused objects.

    runFinalization()方法用于运行已在队列中的任何对象的finalize()方法,以处理未使用的对象。

  • runFinalization() method is a static method, it is accessible with the class name too.

    runFinalization()方法是一个静态方法,也可以使用类名进行访问。

  • runFinalization() method method does not throw any exception.

    runFinalization()方法方法不会引发任何异常。

Syntax:

句法:

    public static void runFinalization();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of this method is void, it does not return anything.

此方法的返回类型为void ,它不返回任何内容。

Example:

例:

// Java program to demonstrate the example of 
// runFinalization () method of System Class
public class RunFinalizationMethod {
public static void main(String[] args) {
// print the state of the program
int i = 10;
System.out.println("The value of i is :" + i);
// Here, we are calling the runFinalization() method 
// that will  call finalize() methods 
// for disposing unused objects
Runtime.getRuntime().runFinalization();
System.out.println("Finalization Done.");
}
}

Output

输出量

E:\Programs>javac RunFinalizationMethod.java
E:\Programs>java RunFinalizationMethod
The value of i is :10
Finalization Done.

翻译自: https://www.includehelp.com/java/system-class-runfinalization-method-with-example.aspx

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/542196.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux中远程文件的传输

1. scp命令 scp file userip:/dir 把自己主机的文件远程复制到其他主机 scp userip:/file dir 把其他主机的文件远程复制到当前主机 注意:要关闭接受端的防火墙 把主机的file远程复制到IP为172.25.254.117的root用户的Desktop 把IP为172.25.254.117的root用户Deskt…

svn: Can't convert string from 'UTF-8' to native

详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt227 svn 版本库中有文件是以中文字符命名的,在 Linux 下 checkout 会报错: svn: Cant convert string from UTF-8 to native encoding 然后 checkout 程序就退出了&#xff…

引入antd组件样式_个人作品:一个技术栈koa2+ mysql+react + antd的个人博客

前言此项目是个人博客,有前端界面后台管理系统;目的是当做react和node的练手项目,同时还可以了解到服务器nginx部署web站点以及备案和域名的基本操作流程。项目预览地址https://www.lxsblog.cn​www.lxsblog.cnGitHub地址LinWeb/blog​github…

Java ObjectOutputStream writeLong()方法与示例

ObjectOutputStream类writeLong()方法 (ObjectOutputStream Class writeLong() method) writeLong() method is available in java.io package. writeLong()方法在java.io包中可用。 writeLong() method is used to write the given 8 bytes long value. writeLong()方法用于写…

浅谈Jfinal急速开发框架

2019独角兽企业重金招聘Python工程师标准>>> 使用Jfinal一段时间了,记得当初14年吧,为了建立一个简单的门户网站,想找个轻量型的急速开发框架,然后搜到Jfinal,然后用了一段时间后,确实不错, 现在吧,随着时间的推移,作者对JFinal的版本迭代也是一直在努力,一直朝着优…

make 怎么降级_Ubuntu 中将 make 的版本降低

最新的 Ubuntu 版本使用的是 make 版本是 4.0.在编译 Android4.4 源码包时,由于 make 版本过高,命令提示行会提示编译 Android4.4 源码包需要 make 的版本为 3.81 或 3.82.build/core/main.mk:42: ****************************************************…

Java ObjectOutputStream writeChar()方法与示例

ObjectOutputStream类writeChar()方法 (ObjectOutputStream Class writeChar() method) writeChar() method is available in java.io package. writeChar()方法在java.io包中可用。 writeChar() method is used to write 2 bytes of a character value. writeChar()方法用于写…

虚拟机的管理

我们采用虚拟机的原因是什么呢,很简单就俩字: 节能 1. 管理虚拟机的命令: virt-manager开启虚拟机管理器virsh list显示正在运行的虚拟机virsh list --all查看所有虚拟机virsh start desktop打开虚拟机virsh shutdown desktop正常关闭虚拟机…

mybatis对java自定义注解的使用——入门篇

转自;https://www.cnblogs.com/sonofelice/p/4980161.html 1. 最近在学习spring和ibatis框架。 以前在天猫实习时做过的一个小项目用到的mybatis,在其使用过程中,不加思索的用了比较原始的一种持久化方式: 在一个包中写一个DAO的接…

Java BigDecimal toBigIntegerExact()方法(带示例)

BigDecimal类的toBigIntegerExact()方法 (BigDecimal Class toBigIntegerExact() method) toBigIntegerExact() method is available in java.math package. toBigIntegerExact()方法在java.math包中可用。 toBigIntegerExact() method is used to convert this BigDecimal int…

Linux中的软件管理

1. 使用已有的网络安装资源安装软件 cd /etc/yum.repos.d/ (移动到yum源指向的文件配置目录下) vim westos.repo (新建文件,yum下后缀必须为.repo) 编辑这个文件里面写 [redhat] (软件仓库名称) namefirefox &#x…

楚留香ai人脸识别_戴口罩居然也能人脸识别?这些AI黑科技真的藏不住了.........

当人工智能遇见影像技术,将会释放出多少意想不到的巨大能量?「喔图知图实验室」瞄准当下的影像痛点,持续发力升级AI黑科技,带来两大必杀技——人脸识别再度升级、AI智能旋转校正。戴口罩也能识别——人脸识别升级戴口罩人脸识别如…

android--------Popupwindow的使用

2019独角兽企业重金招聘Python工程师标准>>> PopupWindow在Android.widget包下,项目中经常会使用到PopupWindow做菜单选项, PopupWindow这个类用来实现一个弹出框,可以使用任意布局的View作为其内容,这个弹出框是悬浮…

使用JavaScript中的示例的escape()函数

While transferring the data over the network or sometimes while saving data to the database, we need to encode the data. The function escape() is a predefined function in JavaScript, which encodes the given string. 在通过网络传输数据或有时将数据保存到数据库…

安装虚拟机的脚本

1. 先安装生成自动安装脚本的工具 yum install system-config-kickstart -y 2. 打开这个软件 system-config-kickstart 基本设置:更改时区为上海,设置root用户密码 2)设置安装方法为网络安装,将共享的镜像文件地址正确填写 3&…

小小小游戏

写着玩 FlappyBird 视频:https://pan.baidu.com/s/1sljIR5z 游戏:https://pan.baidu.com/s/1ge8j7Ej 项目:https://pan.baidu.com/s/1eSysxpw Breakout 视频:https://pan.baidu.com/s/1gfhv4hd 项目:https://pan.baidu.com/s/1hs8xPly QBert 视频:https://pan.baidu.com/s/1s…

go在方法中修改结构体的值_[Go]结构体及其方法

结构体类型可以包含若干字段,每个字段通常都需要有确切的名字和类型。也可以不包含任何字段,这样并不是没有意义的,因为还可以为这些类型关联上一些方法,这里可以把方法看作事函数的特殊版本。函数事独立的程序实体,可…

to_number用法示例_Number()函数以及JavaScript中的示例

to_number用法示例Number()函数 (Number() function) Number() function is a predefined global function in JavaScript, it used to convert an object to the number. If the function is not able to convert the object in a number – it returns "NaN". (Rea…

系统延时任务及定时任务

1. 系统延时任务&#xff1a; at相关命令 at time 设定任务执行时间at> rm -fr /mnt/* 任务动作at> <EOT> <<ctrld 执行任务at的命令&#xff1a; -l ##查看任务列表-c …

cpn tools查看运行时间_Jmeter在Linux下的运行测试

一、JMeterApache JMeter是Apache组织开发的基于Java的压力测试工具。用于对软件做压力测试&#xff0c;它最初被设计用于Web应用测试&#xff0c;但后来扩展到其他测试领域。1.1、JMeter的作用能够对HTTP和FTP服务器进行压力和性能测试&#xff0c; 也可以对任何数据库进行同样…