java code for data structures