Quote:
Originally Posted by euhlmann
2. Reflection!
Code:
Constructor<BinaryImage> ct = BinaryImage.class.getDeclaredConstructor();
ct.setAccessible(true);
BinaryImage img = ct.newInstance();
Or modify WPILib and compile it together with your project, probably a solution that makes more sense.
|
Ew. If it's not visible, it's not meant to be accessible. Reflection is not a tool that should be used in this context. If it's an API, it's not meant to be modified and compiled with your project. Use the tools correctly, and your problems will decrease. Use them incorrectly, and they will multiply.
As for an actual answer, you're not supposed to initialize a BinaryImage. You get them from methods like this one.