-1
I have a "poo1.java file":
package pootest;
public class init{
public static void main(String[] args){
Caneta bic1 = new Caneta();
bic1.cor = "azul";
bic1.tampada = true;
bic1.ponta = 0.5f;
bic1.carga = 45;
bic1.modelo = "comun";
bic1.rabiscar();
}
}
and another file "pen.java":
package pootest;
class Caneta{
String modelo;
String cor;
float ponta;
int carga;
boolean tampada = true;
void tampar(boolean estado){
tampada = estado;
}
void rabiscar(){
if (tampada){
System.out.print("ta tampada seu jumnet$
} else{
System.out.print("boiolage");
}
}
}
and when I compile poo1.java( javac poo1.java ) in the terminal this is the output:
poo1.java:3: error: class init is public, should be declared in a file named init.java public class init{ poo1.java:5: error: cannot find Symbol Pen bic1 = new Pen(); Symbol: class Pen Location: class init poo1.java:5: error: cannot find Symbol Bic1 pen = new Pen(); Symbol: class Pen Location: class init 3 errors
Cade the exit of the terminal?
– user28595
sorry I thought I had put...
– Plankiton
jack working
– Plankiton