Skip to content

Commit

Permalink
small example updates
Browse files Browse the repository at this point in the history
  • Loading branch information
n9Mtq4 committed Jun 21, 2015
1 parent fd9d769 commit f8fad9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/CallStaticMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static void main(String[] args) {
// call a void method
ReflectionHelper.callStaticVoidMethod("printStuff", CallStaticMethods.class);
// the ints default to Integer.class, so this requires a little more work
// as of f3336a1004584e8bf453f3b1d249703173b45d90 this is no longer nessassary! It will remain in the example though.
int i = ReflectionHelper.callStaticIntMethod("addIntegers", CallStaticMethods.class, new Class[]{int.class, int.class}, new Object[]{4, 5});
System.out.println(i);
// call a method with a return of an object
Expand Down
1 change: 1 addition & 0 deletions examples/SetStaticFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static void main(String[] args) {
print(anObject.s);

// now lets set some new values, even though they are private
// this isn't a good example because we are in the same class, but it will work if they are private elsewhere.
ReflectionHelper.setStaticObject("Hello CHANGED World", "text", SetStaticFields.class);
ReflectionHelper.setStaticInt(5555, "integer", SetStaticFields.class);
ReflectionHelper.setStaticObject(new AnObject("This is a changed object"), "anObject", SetStaticFields.class);
Expand Down

0 comments on commit f8fad9f

Please sign in to comment.