In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use preference settings and replace properties settings in JDK 1.4.The content of this article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
JDK 1.4 begins to provide preference settings that provide access to the registry under windows. But the user information is stored under the HKEY_CURRENT_USERSoftwareJavaSoftPrefs key and organized in a tree-like manner. Can be exported as a XML file. Do not know what to use under Linux to achieve registry functions, files? There was no experiment. [@ more@]
Package org.pitfalls.prefs
Import java.util.prefs.*
Public class PreferencesTest {
Private String mailServer
Private String timecardServer
Private String userName
Private String ftpServer
Public void storePreferences () {
Preferences prefs = Preferences.userRoot () .node (
"/ com/server")
Prefs.put ("mail", this.getMailServer ())
Prefs.put ("ftp", this.getFtpServer ())
}
/ * *
* @ param args
, /
Public static void main (String [] args) {
PreferencesTest test = new PreferencesTest ()
Test.setFtpServer ("orlux.org")
Test.setMailServer ("123456")
Test.storePreferences ()
}
Public String getFtpServer () {
Return ftpServer
}
Public void setFtpServer (String ftpServer) {
This.ftpServer = ftpServer
}
Public String getMailServer () {
Return mailServer
}
Public void setMailServer (String mailServer) {
This.mailServer = mailServer
}
Public String getTimecardServer () {
Return timecardServer
}
Public void setTimecardServer (String timecardServer) {
This.timecardServer = timecardServer
}
Public String getUserName () {
Return userName
}
Public void setUserName (String userName) {
This.userName = userName
}
}
So much for sharing about JDK 1.4 pitfalls 2 how to use preferences and replace properties settings. I hope the above can help you and learn more. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.