Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (7k points)

What is the difference between system properties System.getProperties() and environment variables System.getenv() in a JVM?

1 Answer

0 votes
by (13.1k points)

The difference between the two is the access. Environment variables are accessible by any process and Java system properties are only accessible by the process they are added to.

Environment variables are set in the Operating System and system properties are passed as command-line options or set using setProperty().

Want to learn Java? Check out the Java course from Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Mar 7, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Sep 24, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer

Browse Categories

...