Skip to content

Instantly share code, notes, and snippets.

@ayushi24041992
Created December 10, 2019 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayushi24041992/a2cbad0e7452302eea64589e54db5870 to your computer and use it in GitHub Desktop.
Save ayushi24041992/a2cbad0e7452302eea64589e54db5870 to your computer and use it in GitHub Desktop.
package Singleton;
public class MSWord {
String page = "Word Page";
public static void main(String args[]) {
MSWord wordObj = new MSWord();
Printer instance = Printer.getInstance();
instance.print(wordObj);
}
}
package Singleton;
public class AcrobatReader {
String page = "Pdf Page";
public static void main(String args[]) {
AcrobatReader pdfObj = new AcrobatReader();
Printer instance = Printer.getInstance();
instance.print(pdfObj);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment