Sunday, 13 November 2016

Java Program to find the Volume of a Box

Volume of a Box in Java


                  The below program demonstrates simple class creation and perform volume calculation of a box.


Program:


class Box {
double width;
double height;
double depth;
}
public class BoxJavaProgram {
    public static void main(String[] args){
        Box mybox = new Box();
        double vol;
        mybox.width = 20;
        mybox.height = 30;
        mybox.depth = 10;
        vol = mybox.width * mybox.height * mybox.depth;
        System.out.println("Volume is " + vol);
    }
}

Output:


Volume is 6000.0

22 comments :

  1. Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post..Interesting post! Thanks for writing it.What's wrong with this kind of post exactly? It follows your previous guideline for post length as well as clarity.
    Java Training in Chennai

    ReplyDelete
  2. Java training institute in Bangalore Uttarainfo offers excellent Java training,covering the entire spectrum to make understand the Modules better using the newest version of the software
    http://www.uttarainfo.com/java-training-institute-in-bangalore.php

    ReplyDelete
  3. I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon...
    Java Training in Chennai

    ReplyDelete
  4. Great article, really very helpful content you made. Thank you, keep sharing.

    Internet Of Things Services | Austere Technologies

    ReplyDelete
  5. wow...nice blog, very helpful information. Thanks for sharing.

    Quality Management Services | Austere Technologies

    ReplyDelete
  6. Very good informative article. Thanks for sharing such nice article, keep on up dating such good articles.

    Digital Transformation Services | Austere Technologies

    ReplyDelete
  7. VERY INFORMATIVE BLOG. KEEP SHARING SUCH A GOOD ARTICLES.

    Mobility Services | Austere Technologies

    ReplyDelete
  8. Nice blog with excellent information. Thank you, keep sharing.

    Cloud Services | Austere Technologies

    ReplyDelete
  9. Looking so informative, thanks much for sharing the useful article keep posting on...
    Best Online Software Training Institute | Java Online Training

    ReplyDelete
  10. Great article, really very helpful content you made. Thank you, keep sharing.

    No 1 Commerce College in Hyd | Avinash college of commerce

    ReplyDelete
  11. Hi Thanks for the nice information its very useful to read your blog. We provide best System Integration Services

    ReplyDelete
  12. Thank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book best Andaman honeymoon packages

    ReplyDelete
  13. Thank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book ANDAMAN TRIP @ 7999

    ReplyDelete
  14. Hi Thanks for the nice information its very useful to read your blog. We provide best Association Of Chartered Certified Accountants

    ReplyDelete
  15. Hi Thanks for the nice information its very useful to read your blog. We provide Software Development Services

    ReplyDelete
  16. Thank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book ANDAMAN TOUR PACKAGE@14599/

    ReplyDelete