clown.java

来自「hhe example may be useflu」· Java 代码 · 共 51 行

JAVA
51
字号
/** Copyright (c) 1997-1999 Bill Venners. All rights reserved.** Source code file from the book "Inside the Java 2 Virtual Machine,"* by Bill Venners, published by McGraw-Hill, 1999, ISBN: 0-07-135093-4. ** This source file may not be copied, modified, or redistributed* EXCEPT as allowed by the following statements: You may freely use* this file for your own work, including modifications and distribution* in compiled (class files, native executable, etc.) form only. You may* not copy and distribute this file. You may not remove this copyright* notice. You may not distribute modified versions of this source file.* You may not use this file in printed media without the express* permission of Bill Venners. ** BILL VENNERS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE* SUITABILITY OF THIS SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING* BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS* FOR PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BILL VENNERS SHALL NOT* BE LIABLE FOR ANY DAMAGES SUFFERED BY A LICENSEE AS A RESULT OF* USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.*/// On CD-ROM in file opcodes/ex1/Clown.javaclass Clown {    static int hopAround() {        int i = 0;        while (true) {            try {                try {                    i = 1;                }                finally {  // The first finally clause                    i = 2;                }                i = 3;                // This return never completes, because of                // the continue in the second finally clause                return i;            }            finally {      // The second finally clause                if (i == 3) {                     // This continue overrides the return statement                    continue;                }            }        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?