/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package box; import java.util.Scanner; /** * * @author user */ public class Box { Scanner reader = new Scanner(System.in); private float a; private float l; private float p; public float calcularVolumen(){ return a*l*p; } public float getAncho() { return a; } public void setAncho(float ancho) { this.a = ancho; } public float getLargo() { return l; } public void setLargo(float largo) { this.l = largo; } public float getProfundidad() { return p; } public void setProfundidad(float profundidad) { this.p = profundidad; } /** * @param args the command line arguments */ public static void main(String[] args) { Box box = new Box(); box.setAncho(2.5f); box.setLargo(4.8f); box.setProfundidad(10f); System.out.println("el volumen de la caja va ser : "+box.calcularVolumen()); // TODO code application logic here } }