请帮我翻一下这段英语The swi tch statement is used in Listing 5.4 instead of a chain of i f statements.The panel's getMouseAction method returns an integer.If this integer matches one of the named constants following the case label,then the
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 05:58:35
请帮我翻一下这段英语The swi tch statement is used in Listing 5.4 instead of a chain of i f statements.The panel's getMouseAction method returns an integer.If this integer matches one of the named constants following the case label,then the
请帮我翻一下这段英语
The swi tch statement is used in Listing 5.4 instead of a chain of i f statements.The
panel's getMouseAction method returns an integer.If this integer matches one of the named constants following the case label,then the statements following that constant are executed until a b r e a k statement is encountered.If a c a s e does not include a b r e a k,then the execution continues with the next case.The equivalent of the el se construct in an if statement is def aul t followed by statements that are executed if none of the explicit cases occur.
请帮我翻一下这段英语The swi tch statement is used in Listing 5.4 instead of a chain of i f statements.The panel's getMouseAction method returns an integer.If this integer matches one of the named constants following the case label,then the
表5.4使用了switch语句而不是一系列if语句.面板的getMouseAction方法返回一个整数.如果这个整数和某一个case标签后面的所指明的常数匹配,那么这个匹配常数之后的语句都将被执行直到遇到一个break语句.如果一个case标签内的程序不包含break语句,那么程序在执行完这个case标签内的语句后将接着执行下一个case标签内的语句.等价于if语句中的else结构的是default标签,default内的语句将被执行,如果没有任何一个case标签被匹配执行.
整编在解释switch结构/语句的用法,随便找本中文C语言编程的书,查switch的用法,对照就明白了.