QuestionQ80

Variables and Arguments

A sequence includes an Assign activity as shown below:

Question Image

Which variable type allows the Input1, Input2, and Output variables to all be considered valid when they share the same type?

Explanation

The Assign activity's expression concatenates Input1, a space character literal, and Input2 using the '+' operator to produce the Output value. This kind of expression only compiles and executes correctly when the variables involved are String type, since the '+' operator directly supports string concatenation with a string literal. Numeric types such as Int32 or Int64 cannot be combined with a string literal using '+' without first calling .ToString() to convert them, so declaring Input1, Input2, and Output as Int32 or Int64 would cause a type error. Therefore, String is the variable type that makes all three variables valid when they are of the same type.

Learn more

Community Discussion

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