QuestionQ10

UiPath Studio

A developer needs to add items to a list of strings by using the Invoke Method activity. The list is declared as follows:

Question Image

The Invoke Method activity has these properties:

Question Image

The Parameters property is configured as follows:

Question Image

Based on the information displayed in the exhibits, what is the outcome of the Invoke Method activity?

  • A Invoke Method activity will throw an error.
  • B Colors will contain items in the following order: “Red”, “Green”, “Yellow”.
  • C Colors will contain items in the following order: “Yellow:”, “Red”, “Green”.
  • D Colors will contain items in the following order: “Red”, “Green”
Explanation

The Add instance method of List<String> receives the input string "Yellow" and appends it to the existing list. Because the list is initialized with "Red" followed by "Green", it becomes "Red", "Green", "Yellow". UiPath Invoke Method invokes a public instance method on the specified TargetObject and passes parameters in method-signature order.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!