0 LIKES LikeUnLike
Here's the class I want to make:import java.util.*;public class ClaseFecha {//declaracion de variables String dia, mes; public void SetDia(String d){ dia=d;} public String getDia() { return dia;} public void setMes(String m) { mes=m;} public String getMes() { return mes;} public String toString() { return dia+"-"+mes; } }Here is the main:import java.util.*;public class Fecha { public static Scanner tecla=new Scanner(System.in); public static void main(String[] args) {//Crea el objeto con el metodo constructor.Fecha f=new Fecha();String d,m;m="0";d="0";d.setDia("06"); m.setMes("10");System.out.println("La fecha de hoy es: "+f.toString());//modificarSystem.out.print("Qué dÃÂa es hoy (dd)");d=tecla.nextLine();d.setDia(d);System.out.print("Qué mes es hoy (mm)");m=tecla.nextLine();m.setMes(m);System.out.println("Tu Fecha modificada: "+f.toString());}}I get this errors:Fecha.java:19: cannot find symbolsymbol : method setDia(java.lang.String)location: class java.lang.Stringd.setDia("06"); ^Fecha.java:20: cannot find symbolsymbol : method setMes(java.lang.String)location: class java.lang.Stringm.setMes("10"); ^Fecha.java:26: cannot find symbolsymbol : method setDia(java.lang.String)location: class java.lang.Stringd.setDia(d); ^Fecha.java:29: cannot find symbolsymbol : method setMes(java.lang.String)location: class java.lang.Stringm.setMes(m); ^4 errors
Tags:
Report (0) (0) | earlier
Latest activity: earlier. This question has 1 answers.