jvm运行原理实例说明

demo类如下,我们仅用此类来说明jvm运行过程与原理。

/**
 * @Title:     JvmRunDemo.java 
 * @Package:    
 * @Desc:      jvm运行demo 
 * @Copyright: AsiaInfo-Linkage
 * @author:    gaoyb 
 * @date:      Mar 22, 2012 7:42:22 PM 
 * @Email:     [email protected]
 */
public class JvmRunDemo {

	//静态类常量
	public final static String ClASS_CONST = "I'm a Const";
	
	//私有实例变量
	private int instanceVar = 15;

	public static void main(String[] args) {
		
		//调用静态方法
		runStaticMethod();
		
		//调用非静态方法
		JvmRunDemo demo = new JvmRunDemo();
		demo.runNoStaticMethod(100);
	}

	//静态方法
	public static String runStaticMethod() {
		return ClASS_CONST;
	}

	//非静态方法
	public int runNoStaticMethod(int parameter) {
		int methodVar = this.instanceVar * parameter;
		return methodVar;
	}

}


 

 

 

你可能感兴趣的:(jvm,Date,String,Class,email)