单选题类Teacher: class Teacher{   String name; float salary;  Teacher(String name){    this.name = name; }  Teacher(String name,float salary){   this.name = name;    this.salary = salary; } }  执行语句Teacher t = new Teacher(“Tom”,2000.0f);后,字段salary的值是哪一项?()A 2000.0fB 0.0fC null;D 2000

单选题
类Teacher: class Teacher{   String name; float salary;  Teacher(String name){    this.name = name; }  Teacher(String name,float salary){   this.name = name;    this.salary = salary; } }  执行语句Teacher t = new Teacher(“Tom”,2000.0f);后,字段salary的值是哪一项?()
A

 2000.0f

B

 0.0f

C

 null;

D

 2000


参考解析

解析: 暂无解析

相关考题:

The teacher is glad that everyone in her class---------(渴望的)to learn.

阅读以下说明和java代码,将应填入(n)处的字句写在对应栏内。[说明]有若干教师,每个教师只有姓名,一个教师可以指导多名研究生;每名研究生有姓名和研究方向,程序最后输出每个教师指导的所有研究生的姓名和研究方向。[Java程序]public class Teacher {String name;int top=0;Student[] student=new Student[20];public Teacher() {}public Teacher(String name) { this.name=name;}boolean add(Student stu){int len=this.student.length;if (top<len-1) {this.student[top]=siu;(1);return true;}elsereturn (2);}void disp(){System.out.println(“指导老师"”+this.name);System.out.println(“研究生:”);for(int i=0;i<(3);i++){System.out.println(“姓名:”+this.student[i].name+“\t研究方向:”+this.student[i]. search);}}public static void main(String[] args){Teacher t[]={new Teacher(“李明”),new Teacher(“王华”)};Student s1 = new Student(“孙强”,“数据库”);Student s2 = new Student(“陈文”,“软件工程”);Student s3 = new Student(“章锐”,“计算机网络”);if(! t[0].add(s1)) {System.out.println(“每个老师最多只能指导20个学生!”);}if(! t[0].add(a2)) {System.out.println(“每个老师最多只能指导20个学生!”);}if(! t[1].add(s3)) {System.out.println(“每个老师最多只能指导20个学生!”);}for(int i=0;i<2;i++)(4);}}class (5) {String name;String search;public Student(){}public Student(String name,String search){this.name=name;this.search=search;}String getName(){return this.name;}String getSearch(){return this.search;}}

The teacher didn't say anything in the class.(改为同义句)The teacher________ , ________in the class.

能将程序补充完整的选项是( )。class Person{ private int a; public int change(int m){ return m; }}public class Teacher extends Person{ public int b; public static void main(String arg[]) { Person p = new Person(); Teacher t = new Teacher(); int i; ______ }} B.A.i=mB.i=bC. i=p.aD.i=p. change(50)

已建立一个名为teacher的类,保存该类的类库名称是mylib,则删除该类正确的命令是( )。A)REMOVE CLASS mylib OF teacherB)REMOVE CLASS teacher OF mylibC)DELETE CLASS mylib OF teacherD)DELETE CLASS teacher OF rnylib

The teacher is glad that everyone in her class is ________ (渴望的)to learn.

which expression is wrong about learning students' names? () A. It shows students that the teacher is interested in them.B. The teacher could ask individual students to assist with demonstrations.C. The teacher could ask individual students to assist with equipment in the class.D. It shows the teacher is responsible.

A new teacher is coming ()will teach you French. A、whoB、whoseC、whichD、that

类Teacher:classTeacher{Stringname;floatsalary;Teacher(Stringname){this.name=name;}Teacher(Stringname,floatsalary){this.name=name;this.salary=salary;}}执行语句Teachert=newTeacher(Tom”,2000.0f);后,字段salary的值是哪一项?()A.2000.0fB.0.0fC.null;D.2000

阅读以下说明和Java代码,将应填入(n)处的字句写在对应栏内。[说明]本程序的功能是给公司的员工Tom,Jack,Green增加薪水。三人的职位分别是programmer, Manager,CEO。程序由6个类组成:WorkerTest是主类,programmer,Manager,CEO三个类,薪水增加的规则是 programmer的涨幅是5%;Manager的是10%;CEO也是Manager,但是它除了有Manager的涨幅,还有1000元的bonus。接口SalaryRaise提供了一个增加薪水的方法raise()。[java程序]public class WorkerTest {public WorkerTest( ) {}public static void main( String[] args) {Programmer programmer = new Programmer( "Tom" ,3000);Manager manager = new Manager( "Jack" ,4000);CEO ceo = new CEO( "Green" ,4000);Worker [] worker = new Worker[3];programmer, raise( );manager, raise( );ceo. raise( );worker[0] = programmer;worker [1] = manager;worker[2] = ceo;for ( int i = 0 ;i < worker, length; i + + ) {System. out. prinfln (" Name:" + worker [i]. getName ( ) +" \ tSalary:" + worker [i]. getSalary ());public interface SalaryRaise { void raise( ); }public class Worker {public String name;public double (1);public Worker( ) {}public String getName( ) {return name;}public void setName( String name) {this. name = name;}public double getSalary( ) {return salary;}public void setSalary(double salary) { this. salary = salary; }}public class Programmer extends Worker implements (2) {public Programmer( ) {}public void raise( ) {double pets=0.05;double sala = this. getSalary( ) * (1 + pers);this. setSalary (sala);public Programmer( Siring name, double salary) tthis. name = name;this. salary = salary;public class Manager extends (3) implements SalaryRaise {public Manager( ) { }public Manager(String name, double salary) {this. name = name;this. salary = salary;}public void raise( ) {double pets = 0.1;double sala = this. getSalary() * (1 + pers);this. setSalary(sala);}}public class CEO extends Manager implements SalaryRaise {public CEO() {}public CEO( String name,double salary) {this. name = name;this. salary = salary;}public void raise( ) {double bonus = 1000;(4);double sala = this. getSalary( );(5);this. setSalary(sala);}}

阅读以下说明C++代码,将应填入(n)处的字句写在对应栏内。[说明]本程序实现了雇员信息管理功能,其中封装了雇员信息及其设置、修改、删除操作。已知当输入为“Smith 31 2960.0”时,程序的输出是:姓名:Smith 年龄:31 工资:2960姓名:Smith 年龄:31 工资:3500姓名:Mary 年龄:23 工资:2500[C++程序]include <iostream.h>include <string.h>class employee{char *name; //雇员姓名short age; //年龄float salary;//工资public:employee();void set_name(char *);void set_age(short a) {age=a;}void set_salary(float s) {salary=s;}(1);~ employee(){delete[] name;}};employee::employee() { name="";age=0;salary=0.0;void employee::set_name(char *n){ name=new char[strlen(n)+1];(2) (name,n);}void employee::print(){ cout<<"姓名":"<<name<<" 年龄:"<<agc<<" 工资:" <<salary<<endl;}void main(){ char *na;short ag=0;float sa=0;(3);na=new char[10];cin>>na>>ag>>sa;emp.set_name(na);emp.set_age(ag);emp.set_salary(sa);emp.print();(4) (3500.0);emp.print();(5);emp.set_name("Mary");emp.set_age(23);emp.set_salary(2500.0);emp.print();}

创建一个名为myteacher的新类,保存新类的类库名称是mylib,新类的父类是Teacher,正确的命令是 ( )。A. CREATE CLASS mylib OF myteacher AS TeacherB. CREATE CLASS myteacher OF Teacher AS mylibC. CREATE CLASS myteacher OF mylib AS TeacherD. CREATE CLASS Teacher OF mylib AS myteacher

In an English class,the teacher,firstly,plays the radio and asks students to listen to the tape and understand the dialogue.Then,the teacher asks students to read after the tape to imitate the pronunciation.Next,the teacher asks students to repeat the dialogue in pairs...What teaching method does the teacher use in this class?A.Communicative Approach.B.Task-Based Teaching Approach.C.The Audio-Lingual Approach.D.The Audio-Visual Approach.

The teacher asks students to do a group-work task. Before the task, the teacher assigns roles clearly around the class, pointing to each student in turn."You are A ... you are B ..., etc."Here the teacher plays the role of_______A.controllerB.prompterC.facilitatorD.organizer

The salary of an engineer is much higher__.A.than a teacherB.than that of a teacherC.in comparison with a teacher'sD.than of a teacher's

类Teacher:  class Teacher{   String name;   float salary;   Teacher(String name){   this.name = name;  }   Teacher(String name,float salary){   this.name = name;   this.salary = salary;  }  }   执行语句Teacher t = new Teacher(“Tom”,2000.0f);后,字段salary的值是哪一项?() A、 2000.0fB、 0.0fC、 null;D、 2000

类Account中字段声明正确的是?()    A、class Account{  name;  amount;  }B、class Account{  String name;  double amount;  }C、class Account{  String name=1.0;  double amount=”Mike”;  }D、class Account{  String name=”Mike”,double amount=1000.0;  }

public class Employee{       private String name;  public Employee(String name){           this.name = name;      }  public String getName(){         return name;      } }  public class Manager extends Employee{       public Manager(String name){          System.out.println(getName());      } }  执行语句new Manager(“smith”)后程序的输出是哪项?() A、 smithB、 nullC、 编译错误D、 name

类 Student 中字段mark的缺省值是哪项?()   Class Student{   String name;   int age;   float market;   ·········   }  A、0.0fB、numllC、falseD、0E、0.0

我们定义一个Account类来描述银行账户,银行账户有账户名、金额等属性特征,同时有存款、取款等行为特征,下述代码适合描述的是哪项?()     A、class  Accountf      String name;//账户     S tring amount;  //金额      Account (String name)(    ) void deposit (double mount){  //存款     ) void withdraw (double mount){  //取款     }     )B、class  Accountf      String name;//账户d ouole amount;  //金额      Account(double amount){   } void deposit (double mount){  //存款     ) void withdraw (double mount){  //取款     )     )C、class  Accountf      String name;//账户 double amount;  //金额      Account (String name){} void deposit (double mount){//存款     )  void withdraw (double mount){  //取款     )     )D、class Accountf      String name;//账户      double amount;//金额      Account (String name){}      void deposit(){//存款     )  void withdraw(){//取款 )     )

单选题public class Employee{       private String name;  public Employee(String name){           this.name = name;      }  public String getName(){         return name;      } }  public class Manager extends Employee{       private String department;  public Manager(String name,String department){          this.department = department;          super(name);  System.out.println(getName());      }  }  执行语句new Manager(“smith”,”SALES”)后程序的输出是哪项?()A smithB nullC SALESD 编译错误

多选题Which are syntactically valid statement at// point x?()     class Person {     private int a;  public int change(int m){  return m;  }     }  public class Teacher extends Person {     public int b;  public static void main(String arg[]){     Person p = new Person();     Teacher t = new Teacher();    int i;  // point x     }    }Ai = m;Bi = b;Ci = p.a;Di = p.change(30);Ei = t.b.

单选题The teacher asks students to do a group-work task . Before the task, the teacher assigns roles clearly around the class, pointing to each student in turn . "You are A . . . you are B . . ., etc ."Here the teacher plays the role of ______ .AcontrollerBprompterCfacilitatorDorganizer

单选题Tony’s salary as a plumber is much higher than _____.Aa teacherBa teacher hasCthat of a teacher doesDthat of a teacher

单选题Tony’s salary as a plumber is much higher than ______.Aa teacher Ba teacher hasCthat of a teacher doesDthat of a teacher

单选题public class Employee{   private String name;   public Employee(String name){   this.name = name;  }   public String getName(){   return name;  }  }   public class Manager extends Employee{   public Manager(String name){   System.out.println(getName());  }  }   执行语句new Manager(“smith”)后程序的输出是哪项?()A smithB nullC 编译错误D name

问答题What tricks can a teacher teach his students to use to memorize vocabulary?