answersLogoWhite

0


Best Answer

Variable declared inside declaration part is treated as a global variable, which means after translation of jsp file into servlet

  • that variable will be declared outside the service method as an instance variable
  • the scope is available to the complete jsp

Variable declared inside a scriplet will be declared inside a service method as a local variable and the scope is with in the service method.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between variable declared inside the declaration part and variable declared in scriptlet part?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can variable declared in one scriplet access in another scriplet?

No. Variables declared inside a scriptlet are like method local variables which are not accessible outside the scriptlet/method.


How a variable is declared and initialized during declaration in c?

During declaration, the declaration goes like this: extern <type> <variable-name> or <type> <function-name> (<parameter list>);


Difference between declaring a variable and definition a variable?

Declaration is a promise: 'I will define (or has defined) this variable/function somewhere else'.


What is the difference between a static variable a global variable and a local variable?

A static variable is a variable allocated in static storage. A local variable is a variable declared inside a function. A global variable is a variable declared outside of any class or function. Note that local variables and global variables can both be allocated in static storage.


What is different between a definition and declaration of a variable?

A declaration and definition of a variable are nearly synonymous, especially as it is found in source code. However, the concepts are separate. The definition of a variable may include variable name, type, scope, operating range, and initial value(s). Program documentation includes only the definition of a variable; not the declaration. It defines the meaning and use of a variable. Whereas the declaration of a variable indicates to the compiler/interpreter that the name should be recognized as a variable. Understand that when the variable declaration is given in source code it may include the definition, though not always. In some languages a variable may be declared and then defined later as to type, operating range, et al.


Why java do not support global variable declaration?

in order to acheive a inheritance and data encapsulation property global variables are not declared in java.


What is the difference between Declaration and Assignment?

Declaration is basically defining data type and length and assignment is to assign the value. Below is the declaration -- var a integer /* this means we are declaring a variable a as integer data type */ a= 5 /* this is assignment,we are assigning 5 to variable a */


If the variable flag can only be declared once in the program it was declared as what type of variable?

It's a global variable.


Why you have to declare variable first in turbo c?

All variables (and constants) must be declared before they can be used. This is so the compiler knows exactly how much memory to allocate to the variable, as the declaration tells the compiler exactly what the variable's type is.


What is Variable declaration and variable initialization?

...are important things in programming. Example: extern int variable; /* declaration */ int variable= 8; /* definition with initialization */


What is a hole-in-scope?

when inner declaration of a variable hides its outer declaration


What is Difference between local variable and data members or instance variable?

A data member belongs to an object of a class whereas local variable belongs to its current scope. A local variable is declared within the body of a function and can be used only from the point at which it is declared to the immediately following closing brace. A data member is declared in a class definition, but not in the body of any of the class member functions. Data members are accessible to all member function of the class.