What you need are the best-practices (JAVA) and how it works.
For that, i can recommend as an older post
as Macarse said:
Have you read Effective Java?
http://java.sun.com/docs/books/effective/
There is a good amount of good code in
it.
To learn how things are done (in the best way) i'll recommend to always check other people's code, especially the open source projects.
You can always check the jdk source
code, there are some good algorythms
around it:
http://java.sun.com/j2se/1.5.0/source_license.html
Also, sometimes I use to research some
good open source apps code...
edited: Also is a good idea to
participate in communities like
this....
Check this out: http://www.javadb.com/
as Naiku said:
The best option for you to study good
code is to look at some popular open
source projects. I think 2 years is
good enough time to understand code in
these projects. Some of the projects
you could look at:
* openjdk
* apache tomcat
* spring framework
* apache commons (very useful)
* Google collections
Enough for you study and understand a
variety of concepts. I frequently
study code in JDK catalina(tomcat) and
spring, jboss, etc.
For Java Memory Management see this Question