• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference between declaration a variable with Expression and without

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can any one say me the difference between declaring
<%! int Val %>
&
<% int Val %>
Regards,
Sangeetha
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%! int Val %> belong to the servlet class of the jsp page
&
<% int Val %>belong to the jsp_service() method of the servlet class of the jsp page Only accessible within that service() method....
 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai Baran,

I have a Question
<%!
int Str;
%>
What does this means Will this called as decalarative statement
If this is not consider as declared under declarative syntax <%! %>
Then how can the below example is considered
<%!
public class innerclass
{
public void test()
{
System.out.println("Welcome");
}
}
%>
 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anybody can answer this question?
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%!
int Str;
%>
What does this means Will this called as decalarative statement
If this is not consider as declared under declarative syntax <%! %>

If you begin a scriptlet with <%! it is a declaration. It doesn't matter how many lines there are between the start and end markers.
<%!
int Str;
%>
is exactly the same as
<%! int Str; %>
was that your question?
 
reply
    Bookmark Topic Watch Topic
  • New Topic