mirror of
https://github.com/danbulant/introductionToProgramming
synced 2026-05-19 04:18:32 +00:00
add loop
This commit is contained in:
parent
21fe12aa34
commit
f16ba2ddd7
1 changed files with 11 additions and 5 deletions
|
|
@ -48,11 +48,17 @@ public class Printer {
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
print();
|
||||
System.out.println("Printed successfully, thanks for your patronage.");
|
||||
} catch (Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
while(true){
|
||||
try {
|
||||
print();
|
||||
System.out.println("Printed successfully, thanks for your patronage.");
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch(Exception interrupt) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue