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.pswp.cn/news/542196.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/542196.shtml
英文地址,請注明出處:http://en.pswp.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; 也可以對任何數據庫進行同樣…