JAVA Lecture 12 B16



/* * 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 javaapplicationconstructor13; class Box { double height; double width; double depth; //Constructor Box(double h,double w,double d){ height=h; width=w; depth=d; } double volumeCompute() { double vol; vol= height*width*depth; return vol; } } public class JavaApplicationConstructor13 { public static void main(String[] args) { Box obj =new Box(1.4,4.5,3.2); System.out.println("Result "+obj.volumeCompute()); } }


Comments

Popular Posts