标签:
例如:D:\work\src>javac -d . Test.java
package org.Arron;
classTest{
publicstaticvoid main(String args []){
System.out.println("Hello package");
}
}
package org.Arron;
publicclassPerson{
publicString name;
publicint age;
publicvoid introduce(){
System.out.println("name:" + name);
System.out.println("age:" + age);
}
}
package com.ArronAndroid;
classTest{
publicstaticvoid main(String args []){
org.Arron.Person p =new org.ArronAndroid.Person();
p.name ="zhagnsan";
p.age =20;
}
}
import org.Arron.*;
package org.Arron;
publicclassPerson{
publicString name;
publicint age;
publicvoid introduce(){
System.out.println("name");
}
}
package com.ArronAndroid;
import org.Arron.*;
classTest{
publicstaticvoid main(String args []){
Person p =newPerson();
p.name ="zhagnsan";
p.age =20;
}
}
标签:
原文地址:http://www.cnblogs.com/arroneve/p/5815450.html