Java examples for Language Basics:Variable
Calculate Volume of a 3D box using double type variables
public class Main { public static void main(String[] args) { double width = 0.5, height = 1.0, depth = 0.2; System.out.print("Volume of the box (in cubic meter):"); System.out.println(width * height * depth); }/*from w w w . java 2s . c o m*/ }