java提示需要<标识符>
classSingle{privatestaticSingles=newSingle();Singlesb=newSingle();privateSingle(){Sys...
class Single
{
private static Single s = new Single();
Single sb = new Single();
private Single()
{
System.out.print("javasb");
}
public static Single getInstance()
{
return s;
}
sb.getInstance();
}
class SingleDemo
{
public static void main(String []args)
{
Single ss = Single.getInstance();
}
}
1.java:16: 错误: 需要<标识符>
sb.getInstance();
^ 展开
{
private static Single s = new Single();
Single sb = new Single();
private Single()
{
System.out.print("javasb");
}
public static Single getInstance()
{
return s;
}
sb.getInstance();
}
class SingleDemo
{
public static void main(String []args)
{
Single ss = Single.getInstance();
}
}
1.java:16: 错误: 需要<标识符>
sb.getInstance();
^ 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询