In Java, many classes areIterable, Mainly including allCollectionCategory (but not variousMaps). For example, the following code can display all operating system environment variables:
// collections/EnvironmentVariables.java
// {VisuallyInspectOutput}
import java.util.*;
public class EnvironmentVariables {
public static void main(String[] args) {
for(Map.Entry entry: System.getenv().entrySet()) {
System.out.println(entry.getKey() + ": " +
entry.getValue());
}
}
}
PATH: /Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/chy/Library/apache-maven-3.6.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/chy/Library/tomcat9.27/bin
SHELL: /bin/bash
USER: wangyixuan
TMPDIR: /var/folders/_t/s_5zr51n5kv_qc8rkjn_d84h0000gn/T/
SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.V3hV7RDf03/Listeners
XPC_FLAGS: 0x0
VERSIONER_PYTHON_VERSION: 2.7
__CF_USER_TEXT_ENCODING: 0x1F5:0x19:0x34
LOGNAME: wangyixuan
LC_CTYPE: zh_CN.UTF-8
M3_HOME: /Users/chy/Library/apache-maven-3.6.3
PWD: /Users/chy/Documents/JavaProject/Java8
XPC_SERVICE_NAME: com.jetbrains.intellij.1576
JAVA_MAIN_CLASS_16255: EnvironmentVariables
HOME: /Users/chy
System.getenv()Return oneMap , entrySet()Generate a causeMap.EntryComposed of the elementsSet, And thisSet Is an IterableSo it can be usedfor-inCirculation.for-inThe statement is applicable to arrays or any otherIterableBut this does not mean that the array must also be aIterable, There will be no automatic packing
Everyone who learns Java first comes into contact with the configuration of environmental variables. Although the foundation is the only way to go. A brief summary is divided into the following steps:...
What is a python: Python (English pronunciation: / paɪθən / American pronunciation: / paɪθɑːn /), is an object-oriented interpretedComputer programming language,byDutchGuido van Rossum inv...
Save the above to a text file (Note: Modify the JDK root directory of local installation path), and the file suffix changed to bat, you can double-click to run. Check to see if the success of two ways...
Environment Variables environmental variables (environment variables) generally refers to the number of parameters used to specify the operating environment of the operating system in the operating sy...
1. Download maven Download address: http://maven.apache.org/download.cgi 2. Unzip the Maven local address after decompression I put 3. Configure the environment. Edit profile file and add maven path O...
== Introduction to Python-Computer Basics-Operating System, Interaction, Environment Variables == common sense Inside the computer, various information such as numerical values, text, sound, graphics ...
table of Contents 1. Usage scenarios 2. Configuration implementation 2.1. Operating parameters and VM variable settings: 2.2, environment variable settings 2.3, Google Cloud service related settings 3...
Environment variable The relationship between environment variables, user variables and system variables Understanding of environment variables Environment variables in Java Why need to configure envi...
The computer system is crashing, and the system needs to be reinstalled. At this time, when I think of it, I want to back up a copy of the environment variables so that it is convenient to configure o...
1. Download It’s best to download from the official website, you can also find other blog posts, I won’t repeat them here, I will provide you withjdk-8u101-windows-x64.exeThe installation ...