Skip to content

Commit 14f7899

Browse files
committed
small fixes of code blocks
1 parent 89aafcd commit 14f7899

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/pages/learn/01_tutorial/04_mastering-the-api/02_invoke/00_methodhandle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ other exceptions if they arise.
282282
MethodHandles.Lookup lookup = MethodHandles.lookup();
283283
MethodHandle methodHandle = lookup.findStatic(Example.class, "problematicMethod", MethodType.methodType(int.class, String.class));
284284
MethodHandle handler = lookup.findStatic(Example.class, "exceptionHandler",
285-
MethodType.methodType(int.class, IllegalArgumentException.class, String.class));
285+
MethodType.methodType(int.class, IllegalArgumentException.class, String.class));
286286
MethodHandle wrapped = MethodHandles.catchException(methodHandle, IllegalArgumentException.class, handler);
287287

288288
System.out.println(wrapped.invoke("valid")); // outputs "1"
@@ -464,7 +464,7 @@ Let's assume that we have a `target` method:
464464

465465
```java
466466
private static void target(int ignored, int sum, int a, int b) {
467-
System.out.printf("%s + %s equals %s and %s is ignored%n", a, b, sum, ignored);
467+
System.out.printf("%d + %d equals %d and %d is ignored%n", a, b, sum, ignored);
468468
}
469469
```
470470

0 commit comments

Comments
 (0)