Write a program to read and display all environment variables in java using getEnv code example
Example: java get environment variables
public class Env {
public static void main (String[] args) {
for (String env: args) {
String value = System.getenv(env);
if (value != null) {
System.out.format("%s=%s%n",
env, value);
} else {
System.out.format("%s is"
+ " not assigned.%n", env);
}
}
}
}