can we write doget() and service() in same servlet?
No , reason is service method is already implemented by HTTPServlet class . So developer need not require to implement the same. Devloper should implement user request type based method like doGet(),doPost().
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.