Java program startup parameter-D is used to do what? To inquire about the official explanation:
Set a System property value. If Value is a string of contains spaces, you must enclose the string in double quotes:
java-dfoo= "some string" SomeClass
That is,-D is used to set system property values when starting a Java program. If the value is a string and contains spaces, it needs to be wrapped in a pair of double quotation marks.
What is the System attribute value? That is, a string of system properties that are obtained through GetProperties () in the System class.
Let's write a test method to find out!
public class Testsystem {public static void main (String args[]) {System.out.println (System.getproperty ("FUCK.ABC"));}}
Add the JVM parameter-dfuck.abc= "1234" When running the program, then you can see the console output 1234 after running!
It is worth noting that the JVM parameters need to be set instead of the program parameters, note
What does the program arguments refer to here? This refers to the args array in the Main method ~
Java program startup parameter-D is used for what?