网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
Given the following code, which statements concerning the objects referenced through the member variables i, j and k are true, given that any thread may call the methods a, b and c at any time? ()  class Counter {  int v = 0;   synchronized void inc() { v++; }   synchronized void dec() { v--; }   }   public class Q7ed5 {   Counter i;   Counter j;   Counter k;   public synchronized void a() {   i.inc();   System.out.println("a");   i.dec();  }   public synchronized void b() {   i.inc();  j.inc();  k.inc();   System.out.println("b");  i.dec();  j.dec(); k.dec();  }   public void c() {   k.inc();   System.out.println("c");   k.dec();   }   }
A

i.v is guaranteed always to be 0 or 1.

B

j.v is guaranteed always to be 0 or 1.

C

k.v is guaranteed always to be 0 or 1

D

j.v will always be greater than or equal to k.v at any give time.

E

k.v will always be greater than or equal to j.v at any give time.


参考答案

参考解析
解析: 暂无解析
更多 “多选题Given the following code, which statements concerning the objects referenced through the member variables i, j and k are true, given that any thread may call the methods a, b and c at any time? ()  class Counter {  int v = 0;   synchronized void inc() { v++; }   synchronized void dec() { v--; }   }   public class Q7ed5 {   Counter i;   Counter j;   Counter k;   public synchronized void a() {   i.inc();   System.out.println("a");   i.dec();  }   public synchronized void b() {   i.inc();  j.inc();  k.inc();   System.out.println("b");  i.dec();  j.dec(); k.dec();  }   public void c() {   k.inc();   System.out.println("c");   k.dec();   }   }Ai.v is guaranteed always to be 0 or 1.Bj.v is guaranteed always to be 0 or 1.Ck.v is guaranteed always to be 0 or 1Dj.v will always be greater than or equal to k.v at any give time.Ek.v will always be greater than or equal to j.v at any give time.” 相关考题
考题 All the following statements concerning the nature of language change is true except() A language change is inevitableB language change is abruptC language change is universalD language change is extensive

考题 Click the Exhibit button. Given:Which two statements are true if a NullPointerException is thrown on line 3 of class C? () A.The application will crash.B.The code on line 29 will be executed.C.The code on line 5 of class A will execute.D.The code on line 5 of class B will execute.E.The exception will be propagated back to line 27.

考题 In HDLC Protocol, when Supervisory Frame's type code is '00'.About the following statements, which is correct.A.Receive ReadyB.Receive not ReadyC.RejectD.Selective Reject

考题 Which statements concerning the switch construct are true?()  A、All switch statements must have a default label.B、There must be exactly one label for each code segment in a switch statement.C、The keyword continue can never occur within the body of a switch statement.D、No case label may follow a default label within a single switch statement.E、A character literal can be used as a value for a case label.

考题 Which of the following statements concerning intellectual property is wrong?()A、Intellectual property is an intangible creationB、Intellectual property in ludes patents,trademarks,copyrights,etc.C、Intellectual property is a visible creationD、There are some agreement sconcerning intellectual property under the WTO

考题 If a vessel subject to PSC inspection, PSC Officer shall give the inspection to the Captain, the given timeframe for rectification of each deficiency is commonly given in a coded form which called “action code”, which code listed below is used for indication of detention of the vessel?()A、10B、30C、17D、16

考题 Given the following code fragment:     public void create() {     Vector myVect;     myVect = new Vector();      }  Which of the following statements are true?() A、 The declaration on line 2 does not allocate memory space for the variable myVect.B、 The declaration on line 2 allocates memory space for a reference to a Vector object.C、 The statement on line 2 creates an object of class Vector.D、 The statement on line 3 creates an object of class Vector.E、 The statement on line 3 allocates memory space for an object of class Vector.

考题 单选题Which of the following statements concerning energy is correct?()A Energy can be created or destroyedB Energy may not be transformedC The total quantity of energy in the universe is always the sameD None of the above

考题 多选题Concerning the figure below, if a =b, which of the following statements must be true? (Indicate all such statements.)Ac=dBl and k are parallelCm and l are perpendicular

考题 单选题If a vessel subject to PSC inspection, PSC Officer shall give the inspection to the Captain, the given timeframe for rectification of each deficiency is commonly given in a coded form which called “action code”, which code listed below is used for indication of detention of the vessel?()A 10B 30C 17D 16

考题 单选题Which of the following statements concerning cargo is correct?()A Cargoes are any type of goods transported by any type of shipsB Cargoes are goods transported in bulkC Cargoes usually include goods transported in bulk and in containersD Cargoes are usually packaged in containers

考题 多选题Click the Exhibit button.   Given: Which two statements are true if a NullPointerException is thrown on line 3 of class C?()AThe application will crash.BThe code on line 29 will be executed.CThe code on line 5 of class A will execute.DThe exception will be propagated back to line 27.EThe code on line 5 of class B will execute.

考题 单选题Which of the following statements concerning butterfly valves is correct?()A Special tools are required for lapping or grindingB It is impossible to throttle flow with a butterfly valveC To close the valve, it is only necessary to turn the handle a quarter of a turnD The butterfly valve should never be used in a freshwater system

考题 多选题Which statements concerning the following code are true?()   class a {   public a() {}   public a(int i) { this(); }   }   class b extends a {   public boolean b(String msg) { return false; }   }   class c extends b  {  private c() { super(); }   public c(String msg) { this(); }   public c(int i) {}   }AThe code will fail to compile.BThe constructor in a that takes an int as an argument will never be called as a result of constructing an  object of class b or c.CClass c has three constructors.DObjects of class b cannot be constructed.EAt most one of the constructors of each class is called as a result of constructing an object of class c.

考题 多选题Given the following class, which statements can be inserted at position 1 without causing the code to fail compilation?()   public class Q6db8 {   int a;   int b = 0;   static int c;   public void m() {   int d;   int e = 0;   // Position 1   }   }Aa++;Bb++;Cc++;Dd++;Ee++;

考题 单选题Which of the following statements is correct concerning heat transfer?()A Heat is given off from a high temperature region known as a heat sinkB Heat transfer rate is affected most by the size of the heat sink involvedC Heat transfer rate is affected most by the temperature difference between the heat source and the heat sinkD Heat transfer by radiation will occur only by mass motion of a fluid substance

考题 单选题Which of the following statements is true concerning centrifugal pumps?()A They are particularly suited for pumping high viscosity fluidsB They are started with the discharge valve openedC The flow of liquid is developed by imparting energy due to the rotation of an impellerD They are always mounted in a horizontal position

考题 单选题According to this passage, which of the following statements is FALSE?A Many employees don’t like a conservative dress code.B Comfortable clothes make employees more productive.C A casual clothes code is welcomed by young employees.D All the employers in the U. S. are for casual office wear.

考题 单选题Which of the following statements is true concerning any evaporator?()A High conductivity of the distillate indicates distillate salinity is excessiveB Increasing the absolute pressure of the shell will increase the distillers capacityC Mesh separators are used in evaporators to filter the distillateD Reducing the brine density will reduce the heat lost overboard

考题 单选题Which of the following statements concerning fire-tube boilers is correct?()A Combustion gases flow through the tubesB Flames impinge on the tubesC Combustion occurs in the tubesD Water flows through the tubes

考题 单选题Which of the following statements is true concerning the cetane number of diesel fuel?()A The cetane number affects the amount of injection lagB The cetane number is an indication of the fuels viscosityC Ignition lag is reduced with fuels having a high cetane numberD The cetane number is of little significance in the combustion process

考题 单选题Which statements concerning the switch construct are true?()A All switch statements must have a default label.B There must be exactly one label for each code segment in a switch statement.C The keyword continue can never occur within the body of a switch statement.D No case label may follow a default label within a single switch statement.E A character literal can be used as a value for a case label.

考题 单选题Which of the following statements is correct concerning the “flash point ” of a liquid?()A It is lower than the ignition temperatureB It is the temperature at which a substance will spontaneously igniteC It is the temperature at which a substance, when ignited, will continue to bumD It is the temperature at which the released vapors will fall within the explosive range

考题 单选题Which of the following statements is true concerning an oil cooler?()A The oil temperature is less than the cooling water temperatureB The oil pressure is less than the cooling water pressureC The oil pressure is greater than the cooling water pressureD The oil flow control valve is always installed in the oil input line

考题 单选题Which of the following statements concerning fuel atomization in a diesel engine cylinder is correct?()A The greater the atomization, the greater the penetrationB The greater the atomization, the less the penetrationC The degree of atomization has nothing to do with the degree of penetrationD Atomization and penetration are one and the same

考题 单选题Which of the following statements is true concerning Halon 1301 fire extinguishing equipment?()A The agent is considered nontoxic at room temperature in low concentrationsB The agent is less effective than carbon dioxideC Halon primarily extinguishes the fire by coolingD The agent cannot be used on electrical fires because it leaves a residue

考题 单选题Which of the following statements is correct concerning the viscosity of lubricating oil?()A Viscosity will increase as temperature increasesB Viscosity is a measure of a fluid s internal resistance to flowC Viscosity will decrease as temperature decreasesD Viscosity is not dependent on temperature

考题 多选题Given the following code fragment:     public void create() {     Vector myVect;     myVect = new Vector();      }  Which of the following statements are true?()AThe declaration on line 2 does not allocate memory space for the variable myVect.BThe declaration on line 2 allocates memory space for a reference to a Vector object.CThe statement on line 2 creates an object of class Vector.DThe statement on line 3 creates an object of class Vector.EThe statement on line 3 allocates memory space for an object of class Vector.