Error compiling java

1

I have a problem with this code, I had several syntax errors which I already solved, but I'm breaking my head because it does not compile me and I do not know why, it's a school task

    public class Plumones {
    private String color;
    private String marca;
    public String tipo;
    public void escribir(String msg) {
    System.out.println(msg + " usando el plumon " + marca);
    }
    public void pintar() {
    System.out.println("pintando de color " + color + " sobre " + tipo);

    }
    public void setMarca(String marca){
    this.marca = marca;
    }
    public void setColor(String color){
    this.color = color;
    }
    public static void main(String[] args) {
    Plumones plumon = new Plumones ();
    plumon.setMarca(args[1]);
    plumon.setColor(args[0]);
    plumon.tipo = "pizarron";
    plumon.pintar();
    plumon.escribir();
    }
    }
    
asked by Abner Romero 19.04.2018 в 06:38
source

1 answer

2

Do not compile the code because the method escribir() receives a parameter of type String and are calling on the main without passing any parameters. You just have to pass a parameter of type String and ready, eg

plumon.escribir("Un mensaje");
    
answered by 19.04.2018 / 06:43
source