---
# System prepended metadata

title: '003public class Switch-case 上課test {'

---

# 003public class Switch-case 上課test {


 public class xxx {
	
		 public static void main(String[] args)  {
		 int n=10;//10 20 30

		   switch(n){
		   case 10:
		   System.out.println("n的值是10");
		   break;
		   
		   case 20:
		   System.out.println("n的值是20");
		   break;
		   
		   default:
		   System.out.println("n的值不是10也不是20");
		  }
		  System.out.println("我仍有執行到");
		  
		   }
		 }
         
         
![](https://i.imgur.com/ujE0R21.png)

