Thanks guys you have been very helpful in last problem now i have got another problem. I have got 2 files Book.java and ShoppingServlet.java. I have compiled Book.java and it has generated a class file. Shopping sevlet uses Book.java items. here is how the code looks like
Now when I execute this it gives me errors related to Book.java which is already compiled and its class file is available. I have tried to put it in -cp parameter as well here is the kind of error i get
Also note that within a package "ebookshop", it is not not only unnecessary to import any other class in package ebookshop, but in fact it might be part of the problem you're having. The import statement doesn't belong there at all.