The static function getProperties()
is used to read the system properties. It also defines the recent system properties. The recent set of properties will be returned as the property’s object. If there is no recent set, the set of properties will be created and initialized. These properties also contain the values for the keys. Let’s discuss some of these keys.
Keys | Details |
| the version of java virtual machine JVM. |
| version of operating system. |
| directory or path delimiter. |
| java compiler name which is being used. |
| file delimiter. |
| java home installation directory. |
| name of operating system. |
| java virtual machine vendor info. |
| URL for vendor web resources. |
| runtime environment name |
public static Properties getProperties()
NA
: It does not take any arguments.
This function will return the system properties.
Properties
class.The
java.util.Properties
class object contains key and value pair. Both these values areString
type.
The code regarding the getProperties()
is shown below:
import java.lang.*;import java.util.Properties;// Main Classpublic class EdPresso {public static void main(String[] args) {/* Using the getProperties() functionSystem class refers to the Java Virtual Machine that you are using to compile the java code.the getProperties function finds the exact propertiesthat Java virtual Machine on your system attains from your OS*/System.out.println("Here is the the JVM info regarding your OS :");System.out.println();// it is Property ObjectProperties JVM1 = System.getProperties();JVM1.list(System.out);}}