@DavidMcConnachi/

CSE110_Java_Constructor_Example_1

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Rectangle {
	int height;
	int width;

	int getArea(int height, int width) {
		return height * width;
	}
}

public class Main {
	
	public static void main(String[] args) {
		Rectangle myRectangle = new Rectangle();
		System.out.println(myRectangle.getArea(5,5));
	}
}