itgle.com

Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 compone

题目

Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 components high.()


相似考题
参考答案和解析
正确答案:layout = new GridLayout(2, 3);"   or: "LayoutManager layout = new
更多“Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 compone”相关问题
  • 第1题:

    Given:Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()

    A.Point p = Line.getPoint();

    B.Line.Point p = Line.getPoint();

    C.Point p = (new Line()).getPoint();

    D.Line.Point p = (new Line()).getPoint();


    参考答案:D

  • 第2题:

    You define the following regular expression of currency values:regex tx = new regex("^-?\d+(\.\d{2})?$")You are required to write code that will be used to find whether a string in the variable named Bill matches the regular expression or not. You are also required to use this code as the expression in a conditional statement and need to know which code segment to use.What should you do?()

    A.The tx.Matches(Bill)

    B.The tx.Equals(Bill)

    C.The tx.Match(Bill)

    D.The tx.IsMatch(Bill)


    参考答案:D

  • 第3题:

    Accelerated analysis approaches emphasize the construction of(请作答此空)to more rapidly identify business and user requirements for a new system. As an accelerated analysis technology,( )reads the program code and automatically generates the equivalent system model, and the code can be obtained from ( ). All system analysis approaches require some form of( )which includes those techniques to be used to identify or extract system problems and solution requirements from user community. ( )is a classical set of techniques used to collect information about system problems, opportunities, solution requirements, and priorities.

    A. object models
    B. prototypes
    C. use cases
    D. components

    答案:B
    解析:

  • 第4题:

    Which three objects can be components of a menu module?() 

    • A、windows 
    • B、parameters 
    • C、object groups 
    • D、report objects 
    • E、visual attributes 

    正确答案:B,C,E

  • 第5题:

    When selecting a Network Interface Card (NIC), which of the following factors need to be considered?()

    • A、The type of application used on the network
    • B、The type of system bus used by the computers
    • C、The type of memory installed in each computer
    • D、The type of media used in the network topology
    • E、The type of protocols used in the network
    • F、The physical layout of the network hosts

    正确答案:B,D,F

  • 第6题:

    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.

    正确答案:A,D,E

  • 第7题:

    How does the weighty property of the GridBagConstraints objects used in grid bag layout affect the layout of the components?()  

    • A、It affects which grid cell the components end up in.
    • B、It affects how the extra vertical space is distributed.
    • C、It affects the alignment of each component.
    • D、It affects whether the components completely fill their allotted display area vertically.

    正确答案:B

  • 第8题:

    You define the following regular expression of currency values: regex tx = new regex("^-?/d+(/./d{2})?$") You are required to write code that will be used to find whether a string in the variable named Bill matches the regular expression or not. You are also required to use this code as the expression in a conditional statement and need to know which code segment to use. What should you do?()

    • A、The tx.Matches(Bill)
    • B、The tx.Equals(Bill)
    • C、The tx.Match(Bill)
    • D、The tx.IsMatch(Bill)

    正确答案:D

  • 第9题:

    单选题
    Which of the following can be used to insert a new line below the current line inside a vi session?()
    A

    o

    B

    a

    C

    p

    D

    A


    正确答案: B
    解析: 暂无解析

  • 第10题:

    多选题
    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.


    正确答案: C,D
    解析: SL-275中指出:要为一个新对象分配空间必须执行new Xxx()调用,new调用执行以下的操作: 
    1.为新对象分配空间并将其成员初始化为0或者null。 
    2.执行类体中的初始化。(例如在类中有一个成员声明int a=10;在第一步后a=0 ,执行到第二步后a=10)    
    3.执行构造函数。 
    4.变量被分配为一个到内存堆中的新对象的引用。

  • 第11题:

    多选题
    When selecting a Network Interface Card (NIC), which of the following factors need to be considered?()
    A

    The type of application used on the network

    B

    The type of system bus used by the computers

    C

    The type of memory installed in each computer

    D

    The type of media used in the network topology

    E

    The type of protocols used in the network

    F

    The physical layout of the network hosts


    正确答案: C,A
    解析: 暂无解析

  • 第12题:

    填空题
    Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 components high.()

    正确答案: layout = new GridLayout(2, 3);"   or: "LayoutManager layout = new
    解析: 暂无解析

  • 第13题:

    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

  • 第14题:

    When selecting a Network Interface Card (NIC), which of the following factors need to be considered?()

    A. The type of application used on the network

    B. The type of system bus used by the computers

    C. The type of memory installed in each computer

    D. The type of media used in the network topology

    E. The type of protocols used in the network

    F. The physical layout of the network hosts


    参考答案:B, D, F

  • 第15题:

    When servicing a laptop, which of the following components usually requires the keyboard to beremoved before the component can be replaced?()

    • A、Processor
    • B、Hard drive
    • C、Battery
    • D、Optical drive

    正确答案:A

  • 第16题:

    Which statement is true?()  

    • A、 A flow layout can be used to position a component that should resize horizontally when the  container is resized.
    • B、 A grid layout can be used to position a component tat should maintain a constant size even when  the container is resized.
    • C、 A border layout can be used to position component that should maintain a constant size even when  the container is resized.
    • D、 The grid bag layout can be used to give a grid-like layout which differs from the normal grid in that individual rows and columns can have unique sizes.
    • E、 If two components are placed in the same column of a grid bag layout, and one component resizes horizontally, then the other component must resize horizontally.

    正确答案:D

  • 第17题:

    Which of the following can be used to insert a new line below the current line inside a vi session?()

    • A、o
    • B、a
    • C、p
    • D、A

    正确答案:A

  • 第18题:

    Given the following code, write a line of code that, when inserted at the indicated location, will make the overriding method in Extension invoke the overridden method in class Base on the current object.   class Base {   public void print( ) {   System.out.println("base");   }   }   class Extention extends Base {   public void print( ) {   System.out.println("extension");   // insert line of implementation here   }   }   public class Q294d {   public static void main(String args[]) {   Extention ext = new Extention( );   ext.print( );   }   }   Fill in a single line of implementation.()


    正确答案:super.print();

  • 第19题:

    You work as an application developer at Certkiller .com. Certkiller .com has instructed you to create a class named MetricFormula. This class will be used to compare MetricUnit and EnglishUnit objects.The MetricFormula is currently defined as follows (Line numbers are used for reference purposes only): 1. public class MetricFormula2. { 3. 4. } You need to ensure that the MetricFormula class can be used to compare the required objects. What should you do? ()

    • A、 Add the following code on line 1: : IComparable {
    • B、 Add the following code on line 1: : IComparer {
    • C、 Add the following code on line 3: public int Compare (object x, object y) {// implementation code }
    • D、 Add the following code on line 3: public int CompareTo (object obj) {// implementation code }

    正确答案:B,C

  • 第20题:

    单选题
    When building the job stream MASTER#NEW_STREAM in the composer  command line, which option should be used to apply the settings in the  Variable Table "LIVE_VARS" to be associated to the  jobs in the job stream?()
    A

    A

    B

    B

    C

    C

    D

    D


    正确答案: B
    解析: 暂无解析

  • 第21题:

    单选题
    Click the Exhibit button. Given this code from Class B: 25.A a1 = new A(); 26.A a2 = new A(); 27.A a3 = new A(); 28.System.out.println(A.getInstanceCount()); What is the result?()
    A

    Compilation of class A fails.

    B

    Line 28 prints the value 3 to System.out.

    C

    Line 28 prints the value 1 to System.out.

    D

    A runtime error occurs when line 25 executes.

    E

    Compilation fails because of an error on line 28.


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    How does the weighty property of the GridBagConstraints objects used in grid bag layout affect the layout of the components?()
    A

    It affects which grid cell the components end up in.

    B

    It affects how the extra vertical space is distributed.

    C

    It affects the alignment of each component.

    D

    It affects whether the components completely fill their allotted display area vertically.


    正确答案: A
    解析: 暂无解析

  • 第23题:

    单选题
    Given: 12.Date date = new Date(); 13.df.setLocale(Locale.ITALY); 14.String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()
    A

    The value of s is 14-dic-2000.

    B

    The value of s is Dec 14, 2000.

    C

    An exception is thrown at runtime.

    D

    Compilation fails because of an error in line 13.


    正确答案: D
    解析: 暂无解析