Can we declare static variables in JSP page.
Answers were Sorted based on User's Feedback
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 |
Answer / vijayakumar chinnasamy
In Declaration tag (<%! -- %>), you can able declare the
static variable,class, define methods.
| Is This Answer Correct ? | 23 Yes | 4 No |
Answer / srinu
yes we declare the varible as static in a jsp.we declare the
static varible in the declaration tag.
ex:-
<%! static int a=10;%>
| Is This Answer Correct ? | 12 Yes | 3 No |
What is the largest number a double can hold?
What is the this keyword?
How to sort elements in a parallel array in java?
What is the best definition for data?
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.
What is Exception handling in Java How do you handle run time errors please explain with an example
what is the main difference between string and stringbuffer? can you explain it with program?
Nested classes VS Inner classes?
Discuss about garbage collector in Java.
0 Answers Agilent, Integreon, ZS Associates,
What is a line separator in java?
What is a locale?
what is the difference between the methods sleep() and wait()? : Java thread