GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java/Programs/areaRect.java at main · arshcoder13/Java Expand file tree/ Copy pathareaRect.javaMore file actions 28 lines (28 loc) · 644 Bytes / Copy pathareaRect.javaFile metadata and controls28 lines (28 loc) · 644 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 // Program to calculate the area of rectangle using return values - package area; class Rectangle { public int l, b; public void getData(int m, int n) { l = m; b = n; } public int calcArea() { int area = l * b; return area; } } public class AreaRect { public static void main(String[] args) { // TODO Auto-generated method stub int a1, a2; Rectangle r1 = new Rectangle(); Rectangle r2 = new Rectangle(); r1.l = 10; r1.b = 15; a1 = r1.l * r1.b; r2.getData(20, 30); a2 = r2.calcArea(); System.out.println("The area of first rectangle = " + a1); System.out.println("The area of second rectangle = " + a2); } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |