MCQ Single Best Answer Easy

QWhat is the VAR keyword used for in X++?

ID: #9372 Module 12: X++ Overview 177 views
Question Info
#9372Q ID
EasyDifficulty
Module 12: X++ OverviewTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A To define a variable that can change data types
  • B To define a variable of a type that the compiler will determine.
  • C To define an array type variable
  • D To define a container
Correct Answer: Option B

Explanation

Justification:

  1. A variable cannot change data type without explicitly changing or converting the data type with a code statement.
  2. The VAR keyword allows a variable to be defined without explicitly specifying the type; the compiler will automatically determine the data type based on the mandatory initialization expression.
  3. An array can be declared using a data type. For example, “int myArray[10]”, declares an array of type integer with up to 10 values.
  4. A container is declared using the container keyword. For example, “container myContainer”. A container can store variables of mixed data types.

 

Related Lesson: Variable Declaration

Share This Question

Challenge a friend or share with your study group.