This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: extension. Executing: To run a java file use “java HelloWorld”. Notice there is no “.java” extension on the end of the filename. This command tells the Java VM to execute the “HelloWorld.class” file. Flags… Flags: Flags are parameters passed into a “public static void main(String args)” method. If I choose to add flags (parameters) to a program I type each of them after the execution call. After making this call inside out “public static void main(String args)” method, we will have an args array that contains: 0 “fName” 1 “mName” 2 “lName” 3 “-Jr” This is done similar to a “java DisplayName fName mName lName”.split(“ “); command which will split the string up at each space character and insert the resulting words into an array. Command line does the same thing but drops the “java FileName” part of the string before constructing the args array. javac DisplayName.java java DisplayName fName mName lName -Jr...
View Full Document