1.publicclassEmployee{2.Stringname;3.doublebaseSalary;4.Employee(Stringname,doublebaseSalary){5.this.name=name;6.this.baseSalary=baseSalary;7.}8.}And:1.publicclassSalespersonextendsEmployee{2.doublecommission;3.publicSalesperson(Stringname,doublebaseSalary,4.doublecommission){5.//insertcodehere6.}7.}Whichcode,insertedatline7,completestheSalespersonconstructor?()A.this.commission=commission;B.superb();commission=commission;C.this.commission=commission;superb();D.super(name,baseSalary);this.commission=commission;E.super();this.commission=commission;F.this.commission=commission;super(name,baseSalary);
1.publicclassEmployee{2.Stringname;3.doublebaseSalary;4.Employee(Stringname,doublebaseSalary){5.this.name=name;6.this.baseSalary=baseSalary;7.}8.}And:1.publicclassSalespersonextendsEmployee{2.doublecommission;3.publicSalesperson(Stringname,doublebaseSalary,4.doublecommission){5.//insertcodehere6.}7.}Whichcode,insertedatline7,completestheSalespersonconstructor?()
A.this.commission=commission;
B.superb();commission=commission;
C.this.commission=commission;superb();
D.super(name,baseSalary);this.commission=commission;
E.super();this.commission=commission;
F.this.commission=commission;super(name,baseSalary);
相关考题:
下面哪项不是application对象的方法()A、getAttribute(Stringname)B、getCookies()C、getInitParameter()D、setAttribute(Stringname,Objectvalue)
WhichHttpSessionmethodstoresanobjectinasession?() A.put(Stringname.Objectvalue)B.set(Stringname.Objectvalue)C.setAttribute(Stringname.Objectvalue)D.putAttribute(Stringname.Objectvalue)E.addAttribute(Stringname.Objectvalue)
publicclassEmployee{privateStringname;publicEmployee(Stringname){this.name=name;}publicvoiddisplay(){System.out.print(name);}}publicclassManagerextendsEmployee{privateStringdepartment;publicManager(Stringname,Stringdepartment){super(name);this.department=department;}publicvoiddisplay(){System.out.println(super.display()+”,”+department);}}执行语句newManager(smith”,”SALES”)后程序的输出是哪项?()A.smith,SALESB.null,SALESC.smith,nullD.null,null
publicclassEmployee{privateStringname;publicEmployee(Stringname){this.name=name;}publicStringgetName(){returnname;}}publicclassManagerextendsEmployee{privateStringdepartment;publicManager(Stringname,Stringdepartment){this.department=department;super(name);(应于上一行掉位置)System.out.println(getName());}}Super的位置是否在方法的首行执行语句newManager(smith”,”SALES”)后程序的输出是哪项?()A.smithB.nullC.SALESD.编译错误
Whichgetsthenameoftheparentdirectoryfile“file.txt”?() A.Stringname=File.getParentName(“file.txt”);B.Stringname=(newFile(“file.txt”)).getParent();C.Stringname=(newFile(“file.txt”)).getParentName();D.Stringname=(newFile(“file.txt”)).getParentFile();E.Directorydir=(newFile(“file.txt”)).getParentDir();Stringname=dir.getName();
在J2EE中,request对象的()方法可以获取页面请求中一个表单组件对应多个值时的用户的请求数据。A.String getParameter(String name)B.String[] getParameter(String name)C.String getParameterValuses(String name)D.String[] getParameterValues(String name)
【单选题】2、通过()方法可以将内容保存在session中。A.session.setAttribute(String name, Object obj)B.session.getAttribute(String name)C.session.setValues(String name, Object obj)D.session.getValues(String name)
【多选题】下面()是Person类的构造方法。A.private Person(){ }B.Person(String name,int age){ }C.person(String name,int age){ }D.public Person(String name,int age,char sex){ }E.public void Person(String name,int age,char sex){ }
下列选项中,能够获取结果集rs的第一列,列名为name的语句是()A.String name = rs.getString(1);B.String name =rs.getString(0);C.String name =rs.getString(“name”);D.String name =rs.getString(1,“name”);