program :
class Comparison{
public static void main(String[] args) {
char color = 'r' ;
switch(color)
{
case 'R':
System.out.println(" Red ");
break ;
case 'B' :
System.out.println(" Blue");
break ;
case 'G' :
System.out.println("Green") ;
break ;
default :
System.out.println(" Error") ;
break ;
}
}
}
No comments:
Post a Comment