I want to access a variable in my inner class which is declared in my base class method. My base class is a servlet, so I cannot declare this variable as a global variable.
The following code will give you an idea. I want to access variable sort
in my inner class which is declared in my base class servlet method
public class AccessPointsListServlet extends Servlet {
protected void execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
String sort = null;
sort = request.getParameter("Sort");
}
private class InnerClass {
public int evaulate(String first){
if (sort.equalsIgnoreCase("url")) {
// some code
}
}
}
}
Please help