Skip to content

Instantly share code, notes, and snippets.

@dsosby
Created February 6, 2012 20:28
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 dsosby/1754623 to your computer and use it in GitHub Desktop.
Save dsosby/1754623 to your computer and use it in GitHub Desktop.
Patterns
public class Foo {
boolean a;
int b;
public Foo() {
a = true;
b = 42;
}
}
public class Bar {
boolean a;
int b;
public Bar() {
initialize();
}
private void initialize() {
a = true;
b = 42;
}
}
public class Baz {
boolean a;
int b;
private Baz() {
}
public static getBaz() {
Baz instance = new Baz();
instance.a = true;
instance.b = 42;
return instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment