Quantcast
Channel: Pure-Essence.Net » instantiate
Browsing latest articles
Browse All 2 View Live

Image may be NSFW.
Clik here to view.

Java instaniate an abstract class… sort of…

At work I had to create some test data for a junit test. The function I’m testing expects a super abstract class to be passed in and I need to test the same function for bunch of child classes. I wish...

View Article



Image may be NSFW.
Clik here to view.

Java Generics – conditionally instantiate a class

From Class to list of Enums public static <T extends Enum> List<T> getList(Class<T> clazz) { return Arrays.asList(clazz.getEnumConstants()); } So if I want to instantiate a class via...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images