
package com.jmj.principles.dmeo2.after;
public interface Quadrilateral {
package com.jmj.principles.dmeo2.after;
public class Rectangle implements Quadrilateral{
public double getWidth() {
public void setWidth(double width) {
public double getLength() {
public void setLength(double length) {
package com.jmj.principles.dmeo2.after;
public class RectangleDemo {
public static void main(String[] args) {
Rectangle rectangle = new Rectangle();
printLengthAndWidth(rectangle);
public static void resize(Rectangle rectangle){
while (rectangle.getWidth()<=rectangle.getLength()){
rectangle.setWidth(rectangle.getWidth()+1);
public static void printLengthAndWidth(Rectangle rectangle){
System.out.println(rectangle.getLength());
System.out.println(rectangle.getWidth());
package com.jmj.principles.dmeo2.after;
import com.jmj.principles.dmeo2.before.Rectangle;
public class Square implements Quadrilateral {
public double getSide() {
public void setSide(double side) {
public double getLength() {
public double getWidth() {