martes, 9 de noviembre de 2010

dibujo de cuadrado (java)

public class Dibujo{
        private int X;
        private int Y;
        private String Z;
        public void X(int X){
            this.X=X;
        }
        public void Y(int Y){
            this.Y=Y;
        }  
         public void setZ(String Z){
         this.Z=Z;
   }
   public String getZ(){
    return Z;
   }
   public void cuadro(){          
            for(int x=0;x<3;x++)
             System.out.println(Z);
            for(int y=0;y<3-1;y++){
               System.out.println(Z);
           }
       }
-------------------------------------------------------------------------------------------------------

public class Mdibujo{
 
  public static void main(String[]arg){
  
     Dibujo d=new Dibujo();
     d.setZ(arg[0]);
  
     d.cuadro();
    
  }
}


      

No hay comentarios:

Publicar un comentario