>
Exams
>
Computer Science & Information Technology
>
Web Technologies
>
which is the correct syntax for declaring a variab
Question:
Which is the correct syntax for declaring a variable in JSP?
Show Hint
Use <%! %> for declarations and <%= %> for expressions in JSP.
TS PGECET - 2024
TS PGECET
Updated On:
June 02, 2025
<%= declaration %>
<% declaration %>
<%! declaration %>
<% \# declaration %>
Hide Solution
Verified By Collegedunia
The Correct Option is
C
Solution and Explanation
In JSP, the correct way to declare variables and methods is using the declaration tag: <%! ... %>
This adds the code to the servlet's class level, making it accessible throughout the servlet.
Download Solution in PDF
Was this answer helpful?
0
0
Top Questions on Web Technologies
Which of the following allows web pages to be updated asynchronously by exchanging data between web client and server?
TS PGECET - 2024
Computer Science & Information Technology
Web Technologies
View Solution
Which provides a method to avoid element name conflicts in XML?
TS PGECET - 2024
Computer Science & Information Technology
Web Technologies
View Solution
What is the purpose of DTD?
TS PGECET - 2024
Computer Science & Information Technology
Web Technologies
View Solution
Which of the following is NOT a web browser?
TS PGECET - 2024
Computer Science & Information Technology
Web Technologies
View Solution
The function setcookie() is used to
TS PGECET - 2024
Computer Science & Information Technology
Web Technologies
View Solution
View More Questions
Questions Asked in TS PGECET exam
Melting rates of electrodes in manual metal arc welding process is mainly governed by the
TS PGECET - 2024
Manufacturing Processes
View Solution
The maximum area of a rectangle that can be inscribed in a circle of radius $R$ is
TS PGECET - 2024
3D Geometry
View Solution
For the matrix \[ \begin{bmatrix} 2 & 1 & 1 \\ 0 & 2 & 1 \\ 1 & 0 & 1 \end{bmatrix}, \] an Eigen vector among the following vectors is
TS PGECET - 2024
Linear Algebra
View Solution
Which of the following expression is a tautology?
TS PGECET - 2024
Digital Logic
View Solution
The 2’s complement representation of the decimal value $-15$ is
TS PGECET - 2024
Digital Logic
View Solution
View More Questions
TS PGECET Notification
OCT Bhopal Admission 2025
June 02, 2025
OCT Bhopal Admission 2025
Read More