Why the following code does not throw an error while I have used the same binding name.
I also tried ArrayList<Integer> task;
task = new Task();
ArrayList<Task> task;
3
Are you asking why you can't assign a value to a variable before you declare that variable? Also, how is your question related to JDBC? I see your other posts were about JavaScript. Note that Java is a very different language to JavaScript.
2026-03-26 04:29:22 +00:00
Commented3 hours ago
can you show the entire code? For all we know, they're not in the same scope.
2026-03-26 06:05:36 +00:00
Commented1 hour ago
@Abra my guess is, he's trying to figure out why he can have two variables with an identical name.
Are you asking why you can't assign a value to a variable before you declare that variable? Also, how is your question related to JDBC? I see your other posts were about JavaScript. Note that Java is a very different language to JavaScript.
2026-03-26 04:29:22 +00:00
Commented 3 hours ago
can you show the entire code? For all we know, they're not in the same scope.
2026-03-26 06:05:36 +00:00
Commented 1 hour ago
@Abra my guess is, he's trying to figure out why he can have two variables with an identical name.
2026-03-26 07:20:08 +00:00
Commented 40 mins ago