saykotislam

201-15-13993_1(a)

Apr 8th, 2021
51
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.     String name;
  6.     int day;
  7.     String month;
  8.     Holiday(String name, int day, String month){
  9.         this.name=name;
  10.         this.day=day;
  11.         this.month= month;
  12.     }
  13.    
  14.     void dis(){
  15.         System.out.println(name);
  16.         System.out.println(day);
  17.         System.out.println(month);
  18.      }    
  19. }
  20.  
  21. public class Lab4 {
  22.     public static void main(String[] args) {
  23.         String a,b,c;
  24.         int d;
  25.         Scanner x = new Scanner(System.in);
  26.         a=x.nextLine();
  27.         d=x.nextInt();
  28.         c=x.nextLine();
  29.         b=x.nextLine();
  30.        
  31.         Holiday h=new Holiday(a,d,b);
  32.         h.dis();
  33.     }
  34.    
  35. }
RAW Paste Data