Is is acceptable in java to declare and type variables inside a while loop? This from Chapter 7 code:
String task = toDoListCursor.getString(ToDoDBAdapter.TASK_COLUMN);
long created = toDoListCursor.getLong(ToDoDBAdapter.CREATION_DATE_COLUMN);
ToDoItem newItem = new ToDoItem(task, new Date(created));
} while (toDoListCursor.moveToNext());
String task; long created; ToDoItem newItem;
appear before the loop and then just assignments made inside the loop? Seems like the loop will be creating hundreds of variables this way, unless Java somehow manages that automatically.