ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
Can we declare static variables in JSP page.
 Question Submitted By :: Neeraj_passion2001
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Can we declare static variables in JSP page.
Answer
# 1
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 ?    9 Yes 0 No
Rajender
 
  Re: Can we declare static variables in JSP page.
Answer
# 2
In Declaration tag (<%!  -- %>), you can able declare the
static variable,class, define methods.
 
Is This Answer Correct ?    10 Yes 1 No
Vijayakumar Chinnasamy
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
class A{ some variables; public void a()throws Excepion1,Exception2{....} } class B extends A{ variables... public void a()throws E2,E3{.....} } Qns: here override of methods occurs or not,ore else wil give any compilation error or run properly..plz tell me briefly whts happening with the above codes.... Quinnox3
what is Thread?  3
what is meta-Inf? Polaris1
Which containers use a FlowLayout as their default layout?  3
What is advantage of using threads? BMC2
what is bytecode? watz the difference between machine code and bytecode? Oracle3
What will happens if you opened Internet Explorer 4 times?  2
What is an Applet ?  2
What is method Overriding in the perspective of OOPS?  1
How to initialize an Applet ? TCS6
What is the use of an interface?  3
What is the difference between java and .Net? Bosch1
what is d difference between deep cloning and shallow cloning in core java? Satyam2
What is the % operator?  2
what is a transient variable?  2
By what default value is an object reference declared as an instance variable? Wipro1
class{ ... ... interface myinterface{ ... ... } abstract class{ .. .. } ... .. .. } is this possible to write "Interface and/ or Abstract class inside a class ? if possible whcich one is possible is only interface? is only abstract? Logica-CMG2
Difference between String and StringBuffer. IBM3
what is the use of private constructor in core java? Satyam3
Name the methods that used to get and set the text label displayed by a Buttonobject?  1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com