Commit eb48782
committed
feat: Iterate over custom Tuple array using descriptive reference variable
🧠 Logic:
- Defined a `Tuple` class with two string fields: `first` and `second`.
- Created an array of `Tuple` instances to simulate key-value data.
- Used an enhanced for-loop with a descriptive reference variable `ReferencesToStoreValues` to access each tuple.
- Printed each tuple in the format `first: second`, demonstrating tuple-like behavior using objects.
Signed-off-by: Somesh diwan <[email protected]>1 parent 07f6b02 commit eb48782
1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | | - | |
24 | | - | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | | - | |
| 31 | + | |
0 commit comments