- A Only at the beginning of a method
- B Only at the beginning of a class declaration
- C Anywhere in the code (“in-line”)
- D Anywhere within a form
- Share this MCQ
Answer:
C
Share this MCQ
Justification:
- Variables can be declared at the beginning of a method. However, they may be declared elsewhere as well.
- Variables may be declared at the beginning of a class declaration. However, they may be declared elsewhere as well.
- Variables can be declared anywhere in the code for small scopes. In-line variable declaration means you can declare and define the variable in a block of code as you plan to use it.
- Variables are not declared on forms themselves.
Related Lesson: Variable Declaration
Click me to Read more Question & Answer of Module 12: X++ OverviewShare this MCQ