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.

Answers were Sorted based on User's Feedback



Can we declare static variables in JSP page...

Answer / 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

Can we declare static variables in JSP page...

Answer / vijayakumar chinnasamy

In Declaration tag (<%! -- %>), you can able declare the
static variable,class, define methods.

Is This Answer Correct ?    23 Yes 4 No

Can we declare static variables in JSP page...

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

Post New Answer

More Core Java Interview Questions

What are the traverses in Binary Tree?

2 Answers   Adobe, Infosys,


What modifiers can be used with a local inner class?

2 Answers  


what is difference between type 4 driver and type 1 driver?

2 Answers   CMC, CTS, IBM, JK Technosoft, Napier Healthcare,


What is the base class of all exception classes in java?

0 Answers  


What is the destroy method?

0 Answers  


Howmany number of objects we can store in an ArrayList. Is there any limit?

7 Answers   TCS,


What are the advantages of encapsulation in java?

0 Answers  


What is the difference between static and non-static variables in java programming?

0 Answers  


Why isn’t there operator overloading?

0 Answers  


What exactly is java?

0 Answers  


Explain the significance of listiterator.

0 Answers  


Where are variables stored?

0 Answers  


Categories