Skip to content

Commit 6e49d7a

Browse files
Copilotbrunoborges
andauthored
fix: replace var with Object in old code for sequenced-collections (Java 8 compat)
Agent-Logs-Url: https://github.com/javaevolved/javaevolved.github.io/sessions/8cfb63c8-1db5-417c-879c-d67adf70e8b5 Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent ea52861 commit 6e49d7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/collections/sequenced-collections.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ oldApproach: "Index Arithmetic"
1111
modernApproach: "getFirst/getLast"
1212
oldCode: |-
1313
// Get last element
14-
var last = list.get(list.size() - 1);
14+
Object last = list.get(list.size() - 1);
1515
// Get first
16-
var first = list.get(0);
16+
Object first = list.get(0);
1717
// Reverse iteration: manual
1818
modernCode: |-
1919
var last = list.getLast();

0 commit comments

Comments
 (0)