Use Of This Operator Program in Java

  1. public class UseOfThisOperator{  
  2.     public static void main(String[] args){  
  3.         Rectangle rectangle=new Rectangle();  
  4.         rectangle.show(56);  
  5.         int area = rectangle.calculate();  
  6.         System.out.println("The area of a Rectangle is:  " + area);  
  7.     }  
  8. }  
  9.   
  10. class Rectangle{  
  11.     int length, breadth;  
  12.     void show(int length, int breadth){  
  13.         this.length = length;  
  14.         this.breadth = breadth;  
  15.     }  
  16.       
  17.     int calculate(){  
  18.         return(length * breadth);  
  19.     }