scope1.java

来自「java 教程源码」· Java 代码 · 共 16 行

JAVA
16
字号
//c4:Scope1.java
//author:ZhangHongbin 
//This program is protected by copyright laws.
//Variables in method and in class.
public class Scope1
{
	int x=1;
	public static void main(String[] args) 
	{
		int x=2;
		System.out.println("x in main= "+x);
		Scope1 vt = new Scope1();
		System.out.println("x in class= "+vt.x);
	}
}

⌨️ 快捷键说明

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