saykotislam

201-15-13993_1(d)

Apr 8th, 2021
46
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package lab.pkg4;
  2. import java.util.Scanner;
  3.  
  4. class Holiday{
  5.     public String name,month;
  6.     private int day;
  7.  
  8.     public void setname(String Name) {
  9.         name = Name;
  10.     }
  11.  
  12.     public void setMarks(int y) {
  13.         day = y;
  14.     }
  15.     public void setmonth (String Month) {
  16.         month = Month;
  17.     }
  18.     public void dis() {
  19.         System.out.print(name);
  20.         System.out.print(day);
  21.         System.out.println(month);
  22.     }
  23.  
  24.     public static void main(String args[]) {
  25.         Holiday x = new Holiday();
  26.         x.setname("Independence Day ");
  27.         x.setMarks(14);
  28.         x.setmonth(" July");
  29.         x.dis();
  30.     }
  31. }
RAW Paste Data