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

what is a green thread? : Java thread

960


When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?

1016


What is string made of?

919


Can I extend singleton class in java?

1049


What does  mean in regex?

998


What is file in java?

992


What is var keyword ?

1137


Can you call a method on a null object?

973


Can you make a constructor final in Java?

1075


Is string an object?

1066


What is meant by class loader? How many types are there? When will we use them?

926


What is meant by inheritance and what are its advantages?

1049


how come we know the object is no more used in the class?

6383


How can an object be unreferenced?

985


I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?

1130