Professional Documents
Culture Documents
*/
public class Switchstringapp {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package switchstringstatements;
/**
*
* @author pc
*/
public class Switchstringstatements {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String color="blue";
String shirt="Shirt";
switch(color)
{
case "blue":
shirt="blue"+"shirt";
break;
case "red":
shirt="red"+"shirt";
break;
default:
shirt="white"+"shirt";
}
System.out.println("Shirt type:"+ shirt);
// TODO code application logic here
}
}