????java?????????????????????????????????java???????????????????????????????????????
????????class??object?????????????object?????class????????class???????object??
????java??????????“????”??????????????????????????????????Person??
public class Person {
public int age;//????
public String name;//????
public int hight;//???
public int weight;//????
public Person(){
}
public Person(int age??String name??int hight??int weight){
this.age = age;
this.name = name;
this.hight = hight;
this.weight = weight;
}
public void doSth(){
//doSomething
}
}
?????????????????????????????????壬???“???”????Person??????????????????????????????????????????
?????????????????????????£?
????1???????????????????????????????е????/????????????????????????????????????????????“Person?????”?????????????????????????塣?????????????????????????
????2???????????????????
??????????????????????????
????3?????????????????????Я?????????????????????????????????????????????????????С?
????4????????????????????????????????б??????????????????????????????????????????????????????????????????????
??????????????????????÷????????
public class classAndObject {
//???????
public static void staticTest (){
System.out.println("????????????");
}
//???????
public void dynamicTest() {
System.out.println("????????????");
}
public static void main(String[] args) {
classAndObject.staticTest();//???
classAndObject t = new classAndObject();
t.dynamicTest();//???????????????“????.????”????????????????????????????????????????????á?
t.staticTest(); //?????????棺The static method staticTest() from the type classAndObject should be accessed in a static way
//???????????????????????????????ò????????????????????????“??.???????”