java题!
Java code:
package f;
public class TestStudent {
public static void main(String[] args) {
Student s1 = new Student();//创建父类对象
Xue x1 = new Xue();//创建子类对象;
s1.Set("张三 ", "男 ");
s1.Set(18);
s1.Set(88.8);
System.out.println(s1.Info());
x1.Set("李四 ","男 ");
x1.Set("厨师");
x1.Set(18);
x1.Set(99.9);
System.out.println(x1.Info());
Student s2 = new Xue();
s2.Set("小王","女");
s2.Set(26);
s2.Set(33.3);
}
}
class Student{ //父类
String name;
String xingbie;
int age;
double chengji;
public void Set(String name,String xingbie){
this.name = name;
this.xingbie = xingbie;
}
public void Set(int age){
this.age = age;
}
public void Set(double chengji){
this.chengji = chengji;
}
public String GetName(){
return name;
}
public String GetXingBie(){
return xingbie;
}
public int GetAge(){
return age;
}
public double GetChengJi(){
return chengji;
}
public String Info(){
return "名字:" + name + "性别:" + xingbie + "年龄:" + " " + age + " " + "成绩:" + chengji;
}
}
class Xue extends Student{ //子类 集成了父类
String zhiwu;
public void Set(String zhiwu){
this.zhiwu = zhiwu;
}
public String GetZhiWu()
相关问答:
我在jsp页面存上一个session,本页面还可以取出值来.
但是一刷新,或者打开新的页面就取不出值来了.
奇怪的是,我测试另一个程序时候
在jsp页面存上一个session,本页面可以取出值来,刷新或打开新页面值能取出来了.
......
工作地点:上海张江
学历要求:大本或以上
专业要求:计算机相关专业
英语:熟练(美国项目,英语工作环境,英语是必须)
简历投递:wendy_qian@163.com
MSN:wendydzmm@hotmail.com
......
现在遇到这样一个问题:
在java 中编写swing程序, 添加按钮jbServerStart,目的是当点击jbServerStart时,程序会自动创建两个与其他终端通信的对象,代码如下:
private Container createButtonPane ......
10个索引文件,大概40G,tomcat内存设到了1G 用MultiSearcher做查询 MultiSearcher是做成了全局的对象,大概一天左右就会报java heap space ,请高手指点
引用
10个索引文件,大概40G,tomcat内存设到了1G 用M ......