1.

1. class box 2. { 3. int width; 4. int height; 5. int length; 6. int volume; 7. box() 8. { 9. width = 5; 10. height = 5; 11. length = 6; 12. } 13. void volume() 14. { 15. volume = width*height*length; 16. } 17. } 18. class constructor_output 19. { 20. public static void main(String args[]) 21. { 22. box obj = new box(); 23. obj.volume(); 24. System.out.println(obj.volume); 25. } 26. }

A. 100
B. 150
C. 200
D. 250
Answer» C. 200


Discussion

No Comment Found