I have a class called Product () which has the following form:
public class Producto {
private String nombre;
private float precio;
private float iva;
private int unidades;
public Producto(String n, float p, float i, int u){
this.nombre = n;
this.precio = p;
this.iva = i;
this.unidades = u;
}
And I want to create a method through which I can access and process the different fields of the Product. I have created an arrayList on product in which is stored the information of the products that are imported from a text file, which are a product by line and name, price, VAT and units separated by #.
private ArrayList<Producto> productosImportados;
The problem is that this arraylist keeps the products for me, but the entire product in each cell, that is, in cell i, is everything related to that product and I can not treat its fields individually. Nor can I access products Imported.element (i) [j]. Any solution? Thanks.