point.java

来自「Java 程序设计源码 只提供了部分」· Java 代码 · 共 53 行

JAVA
53
字号
class Point
{
	int x,y;
	static int z;
	static final double PI = 3.1415926;
	
	Point()
	{
		//PI = 3.1415926;
		//x = 5;
		//y = 5;
		
		//this(1,1);
	}
	
	Point(int X,int Y)
	{
		//PI = 3.1415926;
		x = X;
		y = Y;
	}
	
	static void output()
	{
		//System.out.println(x);
		//System.out.println(y);
		System.out.println("static void output() is called");
		System.out.println(z);
	}
	
	void output(int X,int Y)
	{
		x = X;
		y = Y;
	}
	
	public static void main(String [] args)
	{
		Point pt;
        pt = new Point();
        pt.output();
        //pt.x = 10;
        //pt.y = 10;
        pt = new Point(3,3);
		pt.output();
		
		pt.output(100,100);
		
		pt.output();
		//z = 1000;
		Point.output();
	}
}

⌨️ 快捷键说明

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