Display Color By Accepting String

No Comment - Post a comment

class Color
{
public static void main(String args[])
{
String a;
a =args[0];
switch(a)
{
case "r" :
System.out.println("Red");
break;

case "b" :
System.out.println("Blue");
break;

case "g" :
System.out.println("Green");
break;

case "y" :
System.out.println("Yellow");
break;

case "w" :
System.out.println("White");
break;

case "o" :
System.out.println("Orange");
break;
}
}
}

 
This Post has No Comment Add your own!

Post a Comment