Created
January 25, 2020 06:28
-
-
Save stolarczykt/5d7fe855cb3024ead3614072a74167df to your computer and use it in GitHub Desktop.
Content coupling example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class<?> clazz = Image.class; | |
Object imageInstance = clazz.newInstance(); | |
Field descriptionField = imageInstance | |
.getClass().getDeclaredField("description"); | |
descriptionField.setAccessible(true); | |
descriptionField | |
.set(imageInstance, "Pen Pineapple Apple Pen"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment