public class Rectangle { private int width; private int height; public int1computeArea() { return width * height; } public String toString() { int a =2computeArea(); return "Rectangle: area = " + a; } }
cannot find symbol symbol: method cube()
public class BrilliantNumber { private int number; public BrilliantNumber(int newNumber) { this.number = newNumber; } public double cubeOverSqure() { double y =1this.cube() /2this.square(); return y; } }
public class BrilliantNumber { private int number; public BrilliantNumber(int newNumber) { this.number = newNumber; }1public int square() { int num, result; num = this.number; result = num * num; return result; }2public int cube() { int num, result; num = this.number; result = num * num * num; return result; } public double cubeOverSqure() { double y =3this.cube() /4this.square(); return y; } }
public class RectangleTest { public void test1() { Rectangle rec = new Rectangle(10, 5); int w, h; w = rec.getWidth(); h = rec.getHeight(); } }