Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

0 votes
33 views
asked by Expert (15k points) 15 23 32

1 Answer

0 votes
This method returns the value of the specified property.
It returns null if the specified property does not exist.
Each property comes as a key/value pair.
There are system properties and user-defined properties.
When a Java program runs, the JVM provides values that may be used by the program as properties.
For example, the os.name system property provides the name of the operating system running the JVM.
To get the value of the user.dir property, you use:
public class MainClass{

  public static void main(String[] args){
    System.out.println(System.getProperty ("user.dir"));     
  }

}

output
C:\users\smith\desktop
answered by Geek (15.3k points) 19 43 70

Related questions

0 votes
1 answer 121 views
121 views asked by augustaina Sr Member (4.8k points) 10 26 32
0 votes
1 answer 130 views
130 views asked by augustaina Sr Member (4.8k points) 10 26 32
0 votes
1 answer 26 views
26 views asked by keem Expert (13.2k points) 29 44 63
0 votes
1 answer 114 views
114 views asked by augustaina Sr Member (4.8k points) 10 26 32
0 votes
1 answer 940 views
940 views asked by augustaina Sr Member (4.8k points) 10 26 32
...