public enum Color {
Red, Orange, Yellow, Green, Cyan, Blue, Purple;
private boolean isRGB(Color color)
{
boolean b;
switch(color){
case Red:
System.out.println("Monday is a work day!!");
break;
case Orange:
System.out.println("Tusday is a work day!!");
case Yellow:
System.out.println("Wednesday is a work day!!");
case Green:
System.out.println("Thursday is a work day!!");
case Cyan:
System.out.println("Friday is a work day!!");
default: b = false;
System.out.println("Sorry this is not a working day!!\nn");
System.out.println("It's weekend!!!");
}
return(b);
}
这是我自己试过的代码。 我在返回(b)中有一个错误,说'b'没有初始化....请帮助。哪一个是线性和二进制搜索的效率
有人能帮我弄清楚我做错了什么! –
这是运动问题,如果需要它......“”........编写一个程序来检查它是否是三种原色之一(红绿蓝,RGB。星期一,星期二......星期五是工作日 –
这与你的问题的标题有什么关系? –