QuestionQ27

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 in the exhibits, what is the outcome of the Invoke Method activity?

  • A An exception will be thrown.
  • B Colors will contain an item with the value "Yellow".
  • C Colors will contain an item with an empty value.
  • D Colors will contain an item with the value "Colors: Yellow".
Explanation

The list variable has no default expression that constructs a List<String>, so it remains Nothing. Add is an instance method, and invoking it on a null target throws an exception. The "Yellow" argument itself matches the method’s required String parameter. UiPath Invoke Method uses TargetObject for instance methods and passes the configured parameters to that method.

Learn more

Community Discussion

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