.
Home About-us Privacy Policy Contact-us Services

Friday, October 16, 2015

Java - Cube program Example - Allprogramexample

ad+1

Cube Program Example
class cube
{
int len;
int width;
int hei;
int volum()   //Method Definaton
{
return(len*width*hei);       
}
}
class cube2
{
public static void main(String aa[])
{
cube cc=new cube();
cc.len=60;
cc.width=20;
cc.hei=10;
int vol=cc.volum();  //Calling a method
System.out.println("The Volum of cube "+vol);
}}


0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates