- import java.util.Scanner;
- public class Shape {
- public static Double value1;
- public static Double value2;
- static class Rectangle {
- public Double computeRectangleArea() {
- return Shape.value1 * Shape.value2;
- }
- }
- static class Triangle {
- public Double computeTriangleArea() {
- return 0.5 * Shape.value1 * Shape.value2;
- }
- }
- }
[text] Shape.java
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: