The folks at Java Ranch take a lot of pride in teaching Java.
One of the greatest rewards for someone who enjoys teaching is being the one to supply that key piece of information that helps a struggling beginner to reach that "Ah Ha!" moment.
That pride and enthusiasm will quickly turn to resentment, however, if it appears that you are cutting and pasting questions straight from a test or homework assignment into your post (Believe it or not, we've even had people paste multiple choice questions in their posts).
By pasting the question into Java Ranch in hopes of getting your work done for you, quickly and easily, you not only cheat yourself out of an education but you insult those who have already put in the work required to understand this material. Ask yourself if having someone else do your homework will help you pass your final exams or get a job later? (Most interviews for development jobs will require you to write some code during the interview! If you don't know your stuff, it will become immediately obvious.)
You are more likely to understand and remember when you work the details out for yourself. If your teacher worded the question in just such a way that answering it would take much of reading, research, and work, there is no way you could get a satisfactory answer here.
Programming is not a simple "facts => program" endeavor. It more like "facts => understanding => creative solution => program". You must have a firm understanding of the underlying concepts for the given technology in order to craft a solution to a problem. By asking others to simply solve your homework problems, you are only training yourself to ask others to think and create for you, not to do it yourself.
This is not to say that Java Ranch isn't a great resource for students.
If you're struggling with a concept, by all means ask.
Please respect the other members by taking the time to ShowSomeEffort. Tell us what you've read, what searches you've already performed (with keywords if possible), what you've tried, etc. If you've tried writing some code to help understand the issue, post it.