Showing posts from August, 2021Show all

19) Write a Java program that finds point lies in Rectangle and Largest Rectangle of two coordinates using constructor instance variable.

source file name:   rectdemo.java import java.io.*; class rectangle { int x,y,len,bd; public rectangle() { x=y=0; len=bd=0; } public rectangle(int lenbd) { x=y=10; len=bd=lenbd; } public rectangle(int xc, int yc, int leng, int bdt) { x=xc; y=yc; len=x+10; bd=y+10; } void display() { System.out.println("x="+…

Read more
123...52