Answer Posted / rajender
yes
we should do in jsp declarative tag only.if we specify
variables in declaration tag, it belongs to class.
<%! static int i=0; %>
and u can not define static variable in scriptlet(<% %>).
as we know that we can not declare a static variable in a
method.
Is This Answer Correct ? | 42 Yes | 5 No |
Post New Answer View All Answers
How do weakhashmap works?
What are the three parts of a lambda expression?
What is a for loop in java?
What is the use of keywords in java?
How can we pass argument to a function by reference instead of pass by value?
What is final variable?
How to call one constructor from the other constructor ?
How arrays are stored in memory in java?
Can we convert list to set in java?
What is diamond operator in java?
How do you allocate memory to object?
What is java in detail?
How do you sort a list in java?
Does java set allow duplicates?
What do you know about the garbage collector in java?