testmembervariable_1.java

来自「主要是对于JAVA的编程的基本语言 希望能够帮得上你。」· Java 代码 · 共 30 行

JAVA
30
字号
package variable;

public class TestMemberVariable_1 {
	
	int age;
	char sex;
	double score;
	boolean married;
	
	public static void main(String[] args) {
		TestMemberVariable_1 obj=new TestMemberVariable_1();
		System.out.println("Your age is "+obj.age);
		System.out.println("Your sex is "+obj.sex);
		System.out.println("Your score is "+obj.score);
		System.out.println("Are you married? "+obj.married);
		System.out.println("=================");
		System.out.println("Your age is "+new TestMemberVariable_1().age);
		System.out.println("Your sex is "+new TestMemberVariable_1().sex);
		System.out.println("Your score is "+new TestMemberVariable_1().score);
		System.out.println("Are you married? "+new TestMemberVariable_1().married);
		System.out.println("=================");
	    System.out.println(Math.ceil(4.56));
	    System.out.println(Math.ceil(-4.56));
	    System.out.println(Math.floor(4.345));
	    System.out.println(Math.floor(-4.345));
	    System.out.println(Math.round(4.345));
	    System.out.println(Math.round(-4.345));
	}
}

⌨️ 快捷键说明

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