A programmer is 

题目

A programmer is designing a class to encapsulate the information about an inventory item. A JavaBeans component is needed to do this. The Inventoryltem class has private instance variables to store the item information:  10. private int itemId;  11. private String name;  12. private String description;  Which method signature follows the JavaBeans naming standards for modifying the itemld instance variable?() 

  • A、 itemID(int itemId)
  • B、 update(int itemId)
  • C、 setItemId(int itemId)
  • D、 mutateItemId(int itemId)
  • E、 updateItemID(int itemId)
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given:What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()

A. It is true that j==i.

B. It is false that j==i.

C. An exception is thrown at runtime.

D. Compilation fails because of an error in line 13.


参考答案:D

第2题:

A company that makes Computer Assisted Design (CAD) software has, within its application, some utility classes that are used to perform 3D rendering tasks. The company‘s chief scientist has just improved the performance of one of the utility classes‘ key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to be replaced exists in only one class. The programmer reviews that class‘s API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class‘s API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly.What design flaw is most likely the cause of these new bugs?()

A.Inheritance

B.Tight coupling

C.Low cohesion

D.High cohesion

E.Loose coupling

F.Object immutability


参考答案:B

第3题:

升级CPLD的版本软件都有()?

A.isPvMSysTeM

B.qUArTUsii_PrOgrAMMer_sigNALTAP

C.CPLD sOfTwAre

D.wfTP32


参考答案:A, B

第4题:

字符串“programmer”中长度为4的子串有__(10)__个。

A.4

B.5

C.6

D.7


正确答案:D
字符串中任意个连续的字符组成的子序列称为该串的子串,根据此很容易做出该题。

第5题:

A programmer must know about a function’s(74)to Call it correctly.

A.location

B.algorithm

C.Interface

D.statements


正确答案:C
解析:程序员需要知道函数的接口才能正确调用该函数。

第6题:

Given:Which exception or error will be thrown when a programmer attempts to run this code?()

A.java.lang.StackOverflowError

B.java.lang.IllegalStateException

C.java.lang.ExceptionInInitializerError

D.java.lang.ArrayIndexOutOfBoundsException


参考答案:C

第7题:

阅读以下说明和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) t

this. 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);

}

}


正确答案:(1)salary (2)SalaryRalse (3)Worker (4) super. raise() (5)sala+=bonus及其等效形式
(1)salary (2)SalaryRalse (3)Worker (4) super. raise() (5)sala+=bonus及其等效形式 解析:(1)从Worker这个类的结构来看,它有两个属性ufinle和salary,因此这里应该填salary;
(2)~(3):很显然Programmer类和Manager类继承于 Worker类和SalaryRaise接口。
(4)~(5):CEO类继承于Manager类,而根据题意, CEO除了有Managor的涨幅,还有1000元的bonus。所以,CEO薪水的涨幅可以使用基类相同的方法super. raise(),然后再加上奖金sala+=bonus即可。

第8题:

【S4】

A.poet

B.architect

C.doctor

D.programmer


正确答案:D

第9题:

A programmer must know about a function's ______ to call it correctly.

A.location

B.algorithm

C.Interface

D.statements


正确答案:D
解析:译文的含义是:程序员需要知道函数的()才能正确调用该函数。A、B、C、D各选项的意思分别是:位置、算法、接口、声明。要正确地调用一个函数,必须知道它的声明,故本题应该选择D。

第10题:

In object-oriented(51), objects can be viewed as reusable components, and once the programmer has developed a(52)of these components, he can(53)the amount of new coding required. But(52)a(54)is no simple task because the integrity of the Original software design is critical. Reusability can be a mixed blessing for user, too, as a programmer has to be able to find the object he needs. But if(55)is your aim, reusability is worth the risk.

A.programming

B.creating

C.indisposing

D.library

E.maximize


正确答案:A

更多相关问题