Skip to content

Instantly share code, notes, and snippets.

@barrowsys
Last active August 2, 2019 20:35
Show Gist options
  • Save barrowsys/5e682a80a0610d1a39b7378da97c6770 to your computer and use it in GitHub Desktop.
Save barrowsys/5e682a80a0610d1a39b7378da97c6770 to your computer and use it in GitHub Desktop.
java helloworld be like
public class HelloWorldWriter {
public void WriteHelloWorld() {
System.out.println("Hello, World!");
}
}
public class HelloWorldWriterFactory {
public HelloWorldWriter CreateHelloWorldWriter() {
return new HelloWorldWriter();
}
}
public class Main {
public static void main(String[] args) {
HelloWorldWriterFactory hwwf = new HelloWorldWriterFactory();
HelloWorldWriter hww = hwwf.CreateHelloWorldWriter();
hww.WriteHelloWorld();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment