FICHERO testLamp21.java import java.lang.String; public class testLamp21{ private boolean valor; private int light; private String lights; private double voltatge; testLamp21 (String lightv) { setLight(lightv); } testLamp21 (testLamp lampv) { setLight(lampv); } testLamp21 (int lightv) { setLight(lightv); } testLamp21(int lightv, double voltatgev) { setLight(lightv); setLight(voltatgev); } testLamp21(double voltatgev) { setLight(voltatgev); } testLamp21() { setLight(0); setLight(0); } void setLight(int light) { if (light<=0) { System.out.println("La llum és apagada"); this.light=0; this.valor=false; } else if (light>101){ this.light=100; this.valor=true; System.out.println("La llum esta al 100% "); } else { System.out.println("la llum esta al "+ light +" %"); this.light=light; this.valor=true; } } void setLight(char light) { if (light<=0) System.out.println("La llum és apagada"); else if (light>101){ this.light=100; System.out.println("La l lum esta al 100%"); } else { System.out.println("la l lum esta al "+ light +" %"); } } void setLight(long light) { if (light<=0) System.out.println("La llum és apagada"); else if (light>101){ this.light=100; System.out.println("La l lum esta al 100%"); } else { System.out.println ("la llum esta al "+ light +" %"); } } void setLight(String lights) { int var=Integer.parseInt(lights); // var=parseInt(light); System.out.println(var+" =var lights=" +lights); if (lights.compareTo(0)==0) System.out.println("La llum és apagaa"); else if (lights.compareTo(100)==0){ this.lights=100; System.out.println("La llum esta al 100%"); } else { System.out.println("la llum esta al "+ this.lights +" %"); } } void setLight(testLamp light) { // String var=light; // var=parseInt(light); System.out.println("Lamp ==="+this.light ); if (this.light<=0) System.out.println("La llum és apagada"); else if (this.light>101){ this.light=100; System.out.println("La l lum esta al 100%"); System.out.println("la llum esta al "+ this. light +" %"); } } void setLight(double voltatge) { if( voltatge < 1.6 ){ this.light=0; this.valor=false; System.out.println("La bombeta està apagada"); } else if( voltatge> 12.5 ){ this.light=100; this.valor=true; System.out.println("La bombeta està aengegada ab la potencia a "+light); } else { this.voltatge=(voltatge*100)/12.5; System.out.println("La bombeta esta al "+ this.voltatge +" %"); } } int getLight(){ return light; } boolean getValor(){ return valor; } String obtenirDades(){ StringBuilder resultats = new StringBuilder(); resultats.append("La llum de la bombeta es: "); resultats.append(String.valueOf(this.getLight())); resultats.append("\nLa bombeta esta : "); resultats.append(String.valueOf(this.getValor())); } else { return resultats.toString(); } } fichero Main21.java import java.io.*; public class Main21{ public static void main(String[] args){ char a='a'; String s="hola"; testLamp21 lamp = new testLamp21(0,0); System.out.println(lamp.obtenirDades()); // testLamp lamp1 = new testLamp(3,5); // System.out.println(lamp1.obtenirDades()); // Lamp lamp2 = new Lamp(5000,5000); // System.out.println(lamp.obtenirDades()); // testLamp lamp3= new testLamp(5); // System.out.println(lamp3.obtenirDades()); // testLamp lamp4= new testLamp(5.3); // System.out.println(lamp4.obtenirDades()); // System.out.println(" testLamp lamp6= new testLamp(a);"); testLamp21 lamp6= new testLamp21(a); System.out.println(lamp6.obtenirDades()); testLamp21 lamp7= new testLamp21(4); System.out.println(lamp7.obtenirDades()); testLamp21 lamp8= new testLamp21(-3456789); System.out.println(" testLamp lamp8= new testLamp(-3456789);"); System.out.println(lamp8.obtenirDades()); testLamp21 lamp9= new testLamp21(6); System.out.println("testLamp lamp9= new testLamp(6);"); System.out.println(lamp9.obtenirDades()); // testLamp21 lamp10=new testLamp21("hola"); // System.out.println("testLamp21 lamp10=new testLamp21(s);"); // System.out.println(lamp10.obtenirDades()); testLamp21 lamp11=new testLamp21(345211111); System.out.println("testLamp21 lamp11=new testLamp21(345211111); "); System.out.println(lamp11.obtenirDades()); System.out.println(" testLamp21 lamp12=new testLamp21(lamp);"); testLamp21 lamp12=new testLamp21(lamp); System.out.println(lamp12.obtenirDades()); } } ERROR DE COMILACION : Main21.java:34: cannot find symbol symbol : constructor testLamp21(testLamp21) location: class testLamp21 testLamp21 lamp12=new testLamp21(lamp); ^ ./testLamp21.java:90: compareTo(java.lang.String) in java.lang.String cannot be applied to (int) if (lights.compareTo(0)==0) System.out.println("La llum és apagada"); ^ ./testLamp21.java:91: compareTo(java.lang.String) in java.lang.String cannot be applied to (int) else if (lights.compareTo(100)==0){ ^ ./testLamp21.java:92: incompatible types found : int required: java.lang.String this.lights=100; ^ 4 errors