For our module “Data Structures and Algorithms”, I had an assignment to find something interesting in the Java class libraries, and analyse it using Java reflection. This assignment was very challenging, and the results had to be presented in a special report format, but I was very happy with my end result of 88%.
This was my first time using reflection in any language, and I was very interested to see the Java language looking and collecting statistics from its own classes etc. Finding something “interesting” in the Java class libraries came as a bit of a challenge – as I wasn’t sure what to aim for.
I started off thinking about Data Structures – something we had learnt a lot about in this module. There is a definite noticeable difference between the speeds of different data structures in Java (especially with large data sets), and this caused me to hypothesise that maybe there would be a relation between the code complexity and the speed of the data structure. In my report I investigated this by building a Java program to collect statistics about the classes, classes referred to by those classes etc and print the results out to the terminal or to a CSV (comma seperated value) file.
You can find my paper here if you are interested, and if anyone was truly interested in the code, I am quite happy to give advice on that too where possible.