tags:

views:

1625

answers:

10

What are the best java example sites? By which I mean places that you go when you have a specific question, and you want a little java code snippet to solve it.

A: 
VonC
+1  A: 

The Java Developer's Almanac: http://www.exampledepot.com/

Gili
A: 

I Like http://www.java2s.com/

Gero
+2  A: 

I like Java Almanac (now renamed www.exampledepot.com/). It has great examples and very pertinent questions, but it only goes through java 1.4, so unfortunately it's pretty out of date. It has good coverage of simple questions like "Quintessential Regular Expression Search and Replace Program" and "Reading Text from a File". Also covers some more complicated topics.

Another site I like is javapractices.com. This one answers questions at a little higher level than Java Almanac, for example "Modernize old code" or "Know the core libraries".

mike
A: 

java2s almost always has a sample on common stuff.

mrlinx
+4  A: 

java2s is the best according to me. because - 1) Like mrlinx said "almost always has a sample on common stuff" 2) Stuffs are nicely organized by category, so, you can easily find out what you are looking for. 3) You can find codes for latest version of JDK

A: 

Wait a minute...
By re-reading your question... I think this site (i.e. stackoverflow) is the very best place for what you are asking for!

You can publish a problematic java snippet and receive answer.
Case in point : What is the syntax for mod in java

I have to leave you now: I need to check my profile.
I might have just received my first "brown-nose" badge ;-)

VonC
Damned... the "brown-nose" base has yet to be implemented!I might mentionned it to stackoverflow.uservoice.com... or not ;)
VonC
A: 

A place I get a lot of samples / answer to questions is the forums of the sun java web site itself. If the answer isn't there, usually users will point you in the right direction.

ShawnD
A: 

I like http://jexamples.com . This has real working code indexed from open source projects. The site also incorporates ratings so the best examples are shown.

A: 

regarding to that ropic:

for all the beginners in Hibernate ,

here you can find a nice video with step by step tutorial how to set up the environment In Hibernate

http://hibernatetutorial.com/Hibernate-tutorial-how-to-set-up-basic-Hibernate-development-environment.html