新手入门:学习掌握动态网页PHP的编程语句

作者:凯旋网络来源:凯旋网络
inaz.com

以下为引用的内容:

switch (condition) {
  case ABC:
  /* falls through */
    statements;
  case DEF:
   statements;
   break;
  case XYZ:
    statements;
    break;
  default:
    statements;
    break;
} Chinaz.com

Chinaz~com

每当一个case顺着往下执行时(因为没有break语句),通常应在break语句的位置添加注释。上面的示例代码中就包含注释/* falls through */。

Www~Chinaz~com

9 try...catch语句

Www.Chinaz.com

一个try-catch语句应该具有如下格式:

Www~Chinaz~com

以下为引用的内容:

try {
  statements;
} catch (ExceptionClass e) {
  statements;
} 站.长站

中.国站长站

一个try-catch语句后面也可能跟着一个finally语句,不论try代码块是否顺利执行完,它都会被执行。

Chinaz_com

以下为引用的内容:

try {
  statements;
} catch (ExceptionClass e) {
  statements;
} finally {
  statements;
} Www@Chinaz@com

中国站.长站

  • 广告推荐