mirror of
https://github.com/danbulant/introductionToProgramming
synced 2026-06-24 17:21:45 +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) {
|
public static void main(String[] args) {
|
||||||
|
while(true){
|
||||||
try {
|
try {
|
||||||
print();
|
print();
|
||||||
System.out.println("Printed successfully, thanks for your patronage.");
|
System.out.println("Printed successfully, thanks for your patronage.");
|
||||||
|
break;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println(e.getMessage());
|
System.err.println(e.getMessage());
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch(Exception interrupt) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue