Lesson 12. Reflection and Other Advanced Topics

In terms of learning enough Java to be able to tackle most problems, you're just about there! This chapter presents some advanced Java topics as well as a few important odds and ends that haven't made their way into your student information system.

You will learn about:

• additional mocking techniques

• anonymous inner classes

• reflection

• adapters

• instance initializers

• the class Class

• the dynamic proxy mechanism

Mock Objects Revisited

In Lesson 10, you created a mock class to force the behavior of a random number generator. The mock class you built extended from the class java.util.Random. You built the mock class as a nested class within the test. Since the mock class was used solely ...

Get Agile Java™: Crafting Code with Test-Driven Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.