This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
There are many types of trees in programming, I am assuming that you are talking of a plain old binary tree.
I was thinking of the program and recalled the days when I was learning data structures for the first time
To start with, a tree node looks something like the following code.
Constructing tree is not much tricky as tree traversal is ;).
P.S The above quick code is inspired from my C/C++ way of doing it. There can be better way of doing it in Java.