Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] d) {
- System.out.println("working");
- // I started this with command line arguments "one two three", so
- System.out.println(d.length);
- // d is an array with three elements
- String S = " rayhan";
- d[1] = S;
- System.out.println(d[1]);
- // if I had started it with no command line arguments, d ould have had no elements,
- // and d[1]=S would have been an array bounds exception.
- // I can always do this
- d=new String[3];
- d[1] = "hello";
- System.out.println(d[1]); // hello
- // but it makes almost no sense
- }
Advertisement
Add Comment
Please, Sign In to add comment