This is a interview question I was asked a week back, The problem was that
You have to develop a music player which gives the user the ability to create a new theme and use it.
I said that let's say there is a theme class like this
Class theme{ par1;
par2;
par3;getter,setter
}
When the user tells our player to create a new theme, we will ask for these parameters and by using setter, we can have a theme object with parameters than can be used for rendering.
However he told me that this a java reflection question, he said you are supposed use reflection to get the class name etc.
Does anybody have any idea how reflection can be used here? or Have they ever been asked a question similar to this? Did they use reflection for solving?
I think it might have something to do with Factory design pattern but I can't find similarities between the question given and the design pattern?