gurpeet singh wrote:you cannod do ServletConfig sc = new GenericServlet() as well as new HttpServlet(); since both GenericServlet and HttpServlet are abstract classes.
Singh Kuldeep wrote:Please some body tell number of object actually created in the above program.
Henry Wong wrote:... There is a common sense reason why instance variables can't be accessed from a static context -- the static context doesn't have access to a "this" variable. If you understand the reason, then you can understand how you can get around the issue, either by using another instance besides the "this" instance, or passing the value via another means, such as a parameter. etc.
jay sugrue wrote:...why then can an instance variable be passed into this static context - is that not against the rules ?
shivam singhal wrote:"classpath is not recognized as an internal or external command operable program or batch file" during compiling the servlet
in cmd as::
javac -classpath /tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java