Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I want a test class to test this class but i dont know how to write it and i tried to see online but i still couldnt figure it out. I wrote the code on BlueJ, i'm trying to create the set game. First you need to decide on the what test cases you need to write for your class , You can use a library like Junit to create test cases once you have the test case list handy.
Functions are very important and useful in any programming language as they make the code reusable A function is a block of code which will be executed only if it is called. If you have a few lines of code that needs to be used several times, you can create a function including the repeating lines of code and then call the function wherever you want. You can create functions with arguments as well. Arguments should be specified within parenthesis.
Recently I have written a lot about jQuery methods and how we can use them. Below image shows the final project structure. We have a very simple servlet that gets the userName from request, create a greetings and return it as plain text. Notice that I am using Servlet-3 annotations for configuration, if you like XML based configuration then you can do it in web.