What is the difference between a variable using a declaration and a variable declared using Scriptlet?

What is the difference between a variable with a declaration and a variable declared using Scriptlet?

<%!  ... %>     :  in declaration
<% ...   %>     :  in scriplet
+3
source share
1 answer

The first is the same as declaring an instance variable in a Java class.

The second option is the same as declaring a local variable inside a method in a Java class.

+6
source

All Articles