Skip to content

Instantly share code, notes, and snippets.

View kepocnhh's full-sized avatar

Stanley Wintergreen kepocnhh

View GitHub Profile
public class UglyObject
{
private int a;
private int b;
public UglyObject(int a, int b)
{
this.a = a;
this.b = b;
}
public interface Pretty
{
int getNumber();
}
public class PrettyObject
implements Pretty
{
private final int a;
private final int b;
public PrettyObject(int a, int b)
{
this.a = a;
this.b = b;
public class UglyClass
{
private int number;
public UglyClass(int number)
{
this.number = number;
}
public int getNumber()
class Logic
{
void update()
{
view.show(data.get());
}
void update(Pretty p)
{
data.set(p);
update();
public class UglyClass
{
private int number;
private String name;
private Date date;
public int getNumber()
{
return number;
}
public class UglyClass
{
public int number;
public String name;
public Date date;
}
UglyClass ugly = new UglyClass();
ugly.setDate(new Date());
Date date = ugly.getDate();
UglyClass ugly = new UglyClass();
ugly.date = new Date();
Date date = ugly.date;
class UglyClass
{
var number: Int = 0
var name: String? = null
var date: Date? = null
}
private boolean numberIsNegative = false;
public void setNumber(int number)
{
this.number = number;
numberIsNegative = number < 0;
}