Skip to content

Instantly share code, notes, and snippets.

@yusufcakal
Created October 28, 2017 23:34
Show Gist options
  • Select an option

  • Save yusufcakal/46390039c62dcebf67804dc58adb903f to your computer and use it in GitHub Desktop.

Select an option

Save yusufcakal/46390039c62dcebf67804dc58adb903f to your computer and use it in GitHub Desktop.
Medium Post
public class Main {
public static void main(String[] args) {
try {
Asus asus = (Asus) ComputerFactory.createComputer(Asus.class);
asus.since(1234);
asus.name();
Mac mac = (Mac) ComputerFactory.createComputer(Mac.class);
mac.name();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment