LINUKS BLOG

Make progress is the topic for ever...

My Photo
Name:
Location: China

It's a fans of computer/ Computer is my favorite/ Making progress is the topic for ever...

Tuesday, July 03, 2007

Switch用法

31.Question:

switch是否能作用在byte上,是否能作用在long上,是否能作用在String上?

Answer:  

switch(expr1)中,expr1是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int、 short、 char 或者 byte。long,string 都不能作用于switch。

0 Comments:

Post a Comment

<< Home