nerdexam
Adobe

9A0-127 · Question #28

You want to instantiate a component, then call two methods of that component and capture the return values in two variables, val1 and val2. Which two should you use to accomplish this? (Choose two.)

The correct answer is C. <cfset myObj = createObject("component", "myComponent")> E. <cfobject name="myObj" component="myComponent">. See the full explanation below for the reasoning.

Question

You want to instantiate a component, then call two methods of that component and capture the return values in two variables, val1 and val2. Which two should you use to accomplish this? (Choose two.)

Options

  • A<cfinvoke component="myComponent" method="method1" returnvariable="val1">
  • B<cfset myObj = createObject("component", "myComponent").method1().method2()>
  • C<cfset myObj = createObject("component", "myComponent")>
  • D<cfset val1 = createObject("component", "myComponent").method1()>
  • E<cfobject name="myObj" component="myComponent">

How the community answered

(39 responses)
  • A
    5% (2)
  • B
    8% (3)
  • C
    85% (33)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 9A0-127 Practice