OK, let me illustrate it:
The return value of a method can be used immediately.
This allows some nice tricks, like chaining calls:
- void setup()
- {
- println(getItems()[2]);
- exit();
- }
- int[] getItems()
- {
- int[] items = { 0, 1, 2, 3, 4, 5 };
- return items;
- }
The return value of a method can be used immediately.
This allows some nice tricks, like chaining calls:
- StringBuilder sb = new StringBuilder("Initial ");
- sb.append("one ").append("two ").append("Last");