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

36 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. This is really great informative blog. Keep sharing.

    Software Security Services | Austere Technologies

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

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

    No 1 Commerce College in Hyd | Avinash college of commerce

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

    chartered accountant coaching in hyderabad | Avinash college of commerce

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

    ReplyDelete
  14. 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
  15. 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
  16. Hi Thanks for the nice information its very useful to read your blog. We provide best Association Of Chartered Certified Accountants

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

    ReplyDelete
  18. 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
  19. Hi Thanks for the nice information its very useful to read your blog. We provide best financial education

    ReplyDelete
  20. Hi Thanks for the nice information its very useful to read your blog. We provide best Certified Financial Analyst

    ReplyDelete
  21. Hi Thanks for the nice information its very useful to read your blog. We provide best Certified Public Accountant

    ReplyDelete
  22. Hi Thanks for the nice information its very useful to read your blog. We provide best Cost And Management Accountancy (CMA)

    ReplyDelete
  23. Hi Thanks for the nice information its very useful to read your blog. We provide best company secretary course

    ReplyDelete
  24. Your article gives lots of information to me. Thanks for sharing.
    acca course in hyderabad | ISFS

    ReplyDelete
  25. Thanks for sharing a valuable information to us. Thanks for your blog.
    CIMA training institute in Hyderabad | ISFS

    ReplyDelete

  26. In the beginning, I would like to thank you much about this great post. Its very useful and helpful for anyone looking for tips. I like your writing style and I hope you will keep doing this good working.
    Ethical Hacking Course in Chennai
    Certified Ethical Hacking Course in Chennai
    PHP Training in Chennai
    ccna Training in Chennai
    Web Designing Course in Chennai
    ethical hacking course in chennai
    hacking course in chennai

    ReplyDelete