Good the problem that I am having with localDate is the following one, it turns out that I am modeling a system of invoicing, for this system creates 2 classes that are invoice and items, but when wanting to create an invoice with the name of the client and the date of that invoice, does not let me do it with the format 00/00/0000 since it throws me a lot of errors, therefore I do not know how to handle localDate with the format of the date.
import java.time.LocalDate;
import java.util.ArrayList;
public class Factura{
private LocalDate fecha;
private String nombreCliente;
DateTimeFormatter formato = DateTimeFormatter.ofPattern("dd/MM/yyyy");
private long precioTotal;
public static ArrayList<Item> lista = new ArrayList<Item>();
public Factura(String nombreCliente,LocalDate fecha){
this.nombreCliente=nombreCliente;
this.fecha=fecha;
}
//metodos get y set
public void ponerNombreCliente(String nombreCliente){
this.nombreCliente=nombreCliente;
}
public void ponerFecha(LocalDate fecha){
this.fecha=fecha;
}
public void ponerPrecioTotal(long precioTotal){
this.precioTotal=precioTotal;
}
public long getPrecioTotal(){
return precioTotal;
}
public LocalDate getFecha(){
return fecha;
}
public String getNombreCliente(){
return nombreCliente;
}
}