Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab.pkg4;
- import java.util.Scanner;
- class Holiday{
- public String name,month;
- private int day;
- public void setname(String Name) {
- name = Name;
- }
- public void setMarks(int y) {
- day = y;
- }
- public void setmonth (String Month) {
- month = Month;
- }
- public void dis() {
- System.out.print(name);
- System.out.print(day);
- System.out.println(month);
- }
- public static void main(String args[]) {
- Holiday x = new Holiday();
- x.setname("Independence Day ");
- x.setMarks(14);
- x.setmonth(" July");
- x.dis();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment