Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/standard_input_ii/delayed_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The problem with this is that Java isn't smart enough to know that you always in
void main() {
String name;
while (true) {
String name = IO.readln("What is your name? ");
name = IO.readln("What is your name? ");
if (name.isBlank()) {
IO.println("Name cannot be blank!");
continue;
Expand All @@ -31,7 +31,7 @@ To get around this you can either give an explicit default value.
void main() {
String name = null;
while (true) {
String name = IO.readln("What is your name? ");
name = IO.readln("What is your name? ");
if (name.isBlank()) {
IO.println("Name cannot be blank!");
continue;
Expand All @@ -52,7 +52,7 @@ to see that the code in the loop will run at least once.
void main() {
String name;
do {
String name = IO.readln("What is your name? ");
name = IO.readln("What is your name? ");
if (name.isBlank()) {
IO.println("Name cannot be blank!");
continue;
Expand Down