Hmmm ... how about a medical simulation that, given the structure and behavior of an HIV virus strain in the body, finds the medical component that eradicates and eliminates all traces of HIV from a person's system.
Your request is a little vague. What do you mean by task? If you're just looking for short exercises to practice Java, then there a plenty of Java books out there and most of them have exercises at the end of each chapter. Perhaps try and Google for "Java exercises" and see what you find.
If you are looking for something a bit more involved, there are a number of open source projects available on the web. However, if you are new to Java, these projects may be beyond your capabilities at this stage. It is probably best to write short simple programs at first to get a good handle on the Java language and API first before diving into full blown development projects.