Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we declare static variables in JSP page.

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


Please Help Members By Posting Answers For Below Questions

how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread

999


Which is faster set or list in java?

1029


What is the purpose of default constructor?

998


What are scriptlets?

1084


What are the 6 functions?

968


What are the two main uses of volatile in Java?

1058


What means public static?

1033


List some important features of java 10 release?

1071


What is the relationship between clipping and repainting under awt?

1148


How do I get 64 bit java?

1103


Can we have two methods in a class with the same name?

1049


Why call by value prevents parameter value change?

1072


What exceptions occur during serialization?

1082


What are the drawbacks of singleton class?

1000


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

1018