VISUAL BASIC

INTRODUCTION TO NET

BASICS OF NET FRAMEWORK

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A local variable
A
Can be used anywhere in the program
B
Is declared within a method
C
Must accept a class
D
Represent a class object
Explanation: 

Detailed explanation-1: -A local variable stores temporary state; it is declared inside a method. A variable declared within the opening and closing parenthesis of a method is called a parameter. Character strings are represented by the class java.

Detailed explanation-2: -Variables declared inside a method are called local variables. Local variables can only be used within the method body.

Detailed explanation-3: -Local variables are declared within a method or within a block of code in a method. In the character-counting example, count is a local variable.

Detailed explanation-4: -A local variable is a variable declared inside a method body, block or constructor. It means variable is only accessible inside the method, block or constructor that declared it. Important Note: In java, a block i.e. “area between opening and closing curly brace” defines a scope.

Detailed explanation-5: -Local variables − Local variables are declared in methods, constructors, or blocks. Local variables are created when the method, constructor or block is entered and the variable will be destroyed once it exits the method, constructor, or block.

There is 1 question to complete.