From e0b32e964590a50297bbd098e372c7b8b21f0ee4 Mon Sep 17 00:00:00 2001 From: general Date: Wed, 25 Oct 2017 21:11:01 -0500 Subject: [PATCH] //Se cambia el parametro SMILE_UP, por SMILE_DW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit //¿Qué pasa si le asigno un numero en lugar de SmileConstants.SMILE_UP? //La voca de la cara desaparece //¿Porqué no genera error? //Porque el objeto recibe 5 parametros --- Patrones2/src/tools/sad/SadPaintableFactory.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Patrones2/src/tools/sad/SadPaintableFactory.java b/Patrones2/src/tools/sad/SadPaintableFactory.java index d96083c..f1c3195 100644 --- a/Patrones2/src/tools/sad/SadPaintableFactory.java +++ b/Patrones2/src/tools/sad/SadPaintableFactory.java @@ -15,9 +15,15 @@ public Paintable create(int x1, int y1, int x2, int y2) { if (useImage) { return new SadImageFace(x1, y1, x2, y2); } else { - return new DrawnFace(x1, y1, x2, y2,SmileConstants.SMILE_UP); + return new DrawnFace(x1, y1, x2, y2,SmileConstants.SMILE_DW); +//Se cambia el parametro SMILE_UP, por SMILE_DW + //¿Qué pasa si le asigno un numero en lugar de SmileConstants.SMILE_UP? + +//La voca de la cara desaparece + //¿Porqué no genera error? +//Porque el objeto recibe 5 parametros } } }