日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

java store()_Java.util.Properties.store()

發(fā)布時間:2025/3/12 java 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java store()_Java.util.Properties.store() 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

描述

所述java.util.Properties.store(OutputStream out,String comments)方法在適合于裝載一個格式轉(zhuǎn)換成使用所述負(fù)載的屬性表在該屬性表寫此屬性列表(key and element )到輸出流(InputStream的)方法。

聲明

以下是java.util.Properties.store()方法的聲明

public void store(OutputStream out,String comments)

參數(shù)

out - 輸出流。

comments - 屬性列表的描述。

返回值

此方法返回此屬性列表中指定鍵的先前值,如果沒有,則返回null。

異常

IOException - 如果將此屬性列表寫入指定的輸出流會拋出IOException。

ClassCastException - 如果此Properties對象包含任何不是字符串的鍵或值。

NullPointerException - 如果out為null。

實例

以下示例顯示了java.util.Properties.store()方法的用法。

package com.tutorialspoint;

import java.io.IOException;

import java.util.*;

public class PropertiesDemo {

public static void main(String[] args) {

Properties prop = new Properties();

// add some properties

prop.setProperty("Height", "200");

prop.put("Width", "1500");

// print the list

System.out.println("" + prop);

try {

// store the properties list in an output stream

prop.store(System.out, "PropertiesDemo");

} catch (IOException ex) {

ex.printStackTrace();

}

}

}

讓我們編譯并運(yùn)行上面的程序,這將產(chǎn)生以下結(jié)果

{Width=1500, Height=200}

#PropertiesDemo

#Sat Jun 30 02:30:14 EEST 2012

Width=1500

Height=200

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎

總結(jié)

以上是生活随笔為你收集整理的java store()_Java.util.Properties.store()的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。