In Java, the system. getproperty () parameter is as follows:
Java. Version JavaRuntime Environment versionJava. Vendor JavaRuntime Environment vendorJava. Vendor. url JavaVendor URLJava. Home JavaInstallation DirectoryJava. VM. Specification.
It mainly uses the properties class in the util package provided by Java. Let's talk about the Code:
View plaincopy to clipboardprint?Import java. util .*;
Public class yourjavaproperties {Public static void main (string ARGs []) {Properties props =
String getproperty (string key, string DEF) gets the system attribute described with the specified key. * If the key is the key of the configuration file such as the key system environment or properties, such as OS. name, return the value of the key
First, describeThere are two ways to get the properties of a system in Java:1. You can use the methods in the System class: public static Properties GetProperties () gets the various propertiesThe method returns a properties class that inherits from
The system. getproperty (string name) method is used to obtain the system attributes. System is a class in the lang package. This class has a lot of practical methods to deal with the system, and is generally a class
Method,. getproperty (string key)
System supports standard input, standard output, and error output streams, access to externally defined attributes and environment variables, and methods for loading files and libraries; there is also a practical method to quickly copy part of the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.