80,362
社区成员
发帖
与我相关
我的任务
分享
package net.xianrenwang.window;
class Location_get {
private String location_get;
// public Location_get(String location_get) {
// this.location_get = location_get;
// }
String getLocation_get() {
return location_get;
}
void setLocation_get(String location_get) {
this.location_get = location_get;
}
@Override
public String toString() {
return "location_get{" +
"location_get='" + location_get + '\'' +
'}';
}
}
class Student{
private String name;
private int age;
public Student() {
}
public Student(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
public class GetDemo {
public static void main(String[] args) {
Student st = new Student("tom",10);
String name = st.getName();
int age = st.getAge();
System.out.println(name+" "+age);
}
}
public class GetDemo {
public static void main(String[] args) {
Student st = new Student("tom",10);
}
Location_get l1 = new Location_get(location_get);
l1.getlocation_get();// 取值