在过去取老婆可以三妻六妾,不过现在有了法律规定一人只能一妻。
public class Wife
{
private static Wife wife = new Wife();
public static Wife getWife()
{
return wife;
}
private Wife()
{
}
}
public class Wife
{
private static Wife wife ;
public static synchronized Wife getWife()
{
if (wife == null)
wife = new Wife();
return wife;
}
private Wife()
{
}