⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multreturntypetrycatchfinallytest.java

📁 eclipseme的最新版本的source,欢迎j2me程序员使用
💻 JAVA
字号:
/**
 * Copyright (c) 2003-2004 Craig Setera
 * All Rights Reserved.
 * Licensed under the Eclipse Public License - v 1.0
 * For more information see http://www.eclipse.org/legal/epl-v10.html
 */
package preverification.inputs;

import preverification.tests.ITestable;
import preverification.tests.TestException;

/**
 * Type description
 * <p />
 * Copyright (c) 2003-2004 Craig Setera<br>
 * All Rights Reserved.<br>
 * Licensed under the Eclipse Public License - v 1.0<p/>
 * <br>
 * $Revision: 1.3 $
 * <br>
 * $Date: 2005/10/22 20:22:30 $
 * <br>
 * @author Craig Setera
 */
public class MultReturnTypeTryCatchFinallyTest implements ITestable {
	/**
	 * @see preverification.tests.ITestable#test(java.lang.Object[])
	 */
	public Object test(Object[] arguments) 
		throws TestException 
	{
		Object returnValue = null;
		
		try {
			returnValue = new Integer(testInt());
		} catch (Exception e) {
			returnValue = new Long(testLong());
		} finally {
			returnValue = new Object();
		}
		
		test2(5);
		
		return returnValue;
	}
	
	private void test2(int switchValue) {
		Object testValue = null;
		
		if (switchValue > 0) {
			testValue = new Object();
		} else {
			testValue = "Test String";
		}
		
		System.out.println(testValue);
	}
	
	private int testInt() {
		int value = 0;
		
		try {
			value = 1;
		} catch(Exception e) {
			value = 2;
		} finally {
			value = 3;
		}
		
		return value;
	}
	
	private long testLong() {
		long value = 0;
		
		try {
			value = 1;
		} catch(Exception e) {
			value = 2;
		} finally {
			value = 3;
		}
		
		return value;
	}
}

⌨️ 快捷键说明

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