-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
39 lines (30 loc) · 763 Bytes
/
Test.java
File metadata and controls
39 lines (30 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.qf.day14OOP;
public class Test {
public static void main(String[] args) {
//
//// 2、测试Student类
// Student s=new Student();
//// s.name;field name is not visable
//// s.setAge(180);
// s.setAge(18);
// s.getAge();
// System.out.println(s.getAge());
// s.setName("王二狗");
// System.out.println(s.getName());
// s.setMarried(true);
// System.out.println(s.ismarried());
// 1、测试Person类
// Person p1 =new Person();
// p1.age=18;
// p1.name="王二狗";
// System.out.println(p1.name);
// System.out.println(p1.age);
// p1.eat();
// p1.eat();
//
// new Person().eat();
// new Person(22, "王二狗").eat();
//// Person p3=null;
//// p3.eat();空指针java.lang.NullPointerException
}
}