Are you learning Java? Are you constantly looking for some samples? There are some web sites you can use to look up Java code that exists on the web. You can also learn a lot by looking at well designed Java frameworks and api libraries.
Even if you are an experienced Java programmers, you may constantly look for Java classes that you may reuse.
Maven Repository online
This is sort of like CPAN for Perl.