Skip to content

Commit cb6d48e

Browse files
committed
#21 - Java
1 parent d45d52e commit cb6d48e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Roadmap/21 - CALLBACKS/java/JimsimroDev.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
public class JimsimroDev {
19-
19+
private static final String DIV_LINE =":::::::::::::::::::::::::";
2020
private static final int MIN = 1000;
2121
private static final int MAX = 10000;
2222

@@ -45,20 +45,23 @@ static int ramdon() {
4545

4646
static void procesarPedidos(String plato, Callback callback) {
4747
try {
48-
System.out.println("Iniciando pedido....");
48+
print(DIV_LINE);
49+
print("Iniciando pedido....");
4950
Thread.sleep(ramdon());
5051
callback.notificar(plato + " Confirmado");
5152

52-
System.out.println("Preparando pedido");
53+
print(DIV_LINE);
54+
print("Preparando pedido....");
5355
Thread.sleep(ramdon());
5456
callback.notificar(plato + " Listo");
5557

56-
System.out.println("Entregando el plato " + plato);
58+
print(DIV_LINE);
59+
print("Entregando el plato", plato);
5760
Thread.sleep(ramdon());
5861
callback.notificar(plato + " Entregado");
5962

6063
} catch (InterruptedException e) {
61-
System.out.println("Error timeout " + e);
64+
print("Erro no pedido" + e);
6265
}
6366
}
6467

@@ -71,6 +74,12 @@ public void notificar(String mensaje) {
7174
}
7275
});
7376
}
77+
static void print(Object... args){
78+
for (Object s : args){
79+
System.out.print(s + " ");
80+
}
81+
System.out.println();
82+
}
7483

7584
public static void main(String[] args) {
7685
notificacionEnviada("Enviando SMS ", new Noficar() {

0 commit comments

Comments
 (0)