To declare variable or method in JSP declaration tag is used.
In this example we are declaring the field and printing the value of the declared field using the jsp expression tag.
<!DOCTYPE html>
<html>
<head>
<title>Declaration tag</title>
</head>
<body>
<%! int a=100; %>
<%= "Value of the variable is:"+a %>
</body>
</html>