JeffGrigg

Main Parameter Madness Java

Oct 1st, 2021 (edited)
941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.45 KB | None | 0 0
  1. public class MainMadness {
  2.     public static void main(String[] args) {
  3.         System.out.println("Number of command line arguments = " + args.length);
  4.         for (int i = 0; i < args.length; ++i) {
  5.             System.out.println("args[" + i + "] = " + args[i]);
  6.             for (int j = 0; j < args.[i].length(); ++j) {
  7.                 System.out.println("  args[" + i + "].charAt(" + j + ") = " + args[i].charAt(j));
  8.             }
  9.         }
  10.     }
  11. }
  12.  
Add Comment
Please, Sign In to add comment