class1.java

来自「JAVA程序做的一个经典的例子」· Java 代码 · 共 27 行

JAVA
27
字号
/**
 * This class can take a variable number of parameters on the command
 * line. Program execution begins with the main() method. The class
 * constructor is not invoked unless an object of type 'Class1'
 * created in the main() method.
 */
import addser.*;

public class Class1
{
	/**
	 * The main entry point for the application. 
	 *
	 * @param args Array of parameters passed to the application
	 * via the command line.
	 */
	public static void main (String[] args)
	{
		// TODO: Add initialization code here
		AddSer_Dispatch obj=(AddSer_Dispatch) new AddSer();
		int x=2;
		int y=3;
		int z=obj.sum (x,y);
		System.out.println(x + "+" + y + "=" + z + "\n\n");
	}
}

⌨️ 快捷键说明

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