Advertisement
kiwser

201-15-13876_Md Kiwser Ahmed Sajib

Feb 9th, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package com.company;
  2. class rectangle{
  3.     private int height;
  4.     private int width;
  5.     public setdata (int t, int s)
  6.     {
  7.         height= t;
  8.         width = s;
  9.     }
  10.     public void display(){System.out.println(height+width)}
  11. }
  12. public class Main {
  13.  
  14.     public static void main(String[] args) {
  15.         rectangle.setdata ("");
  16.         rectangle a = new height(t:"101",s"t");
  17.         rectangle b = new width(t:"102",s"y");
  18.         a.display();
  19.         b.display();
  20.  
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement