BAEL-1441: Method Handles in Java 9 (#3565)

* Added MethodHandles API code

* Added Reflection API example for comparison
This commit is contained in:
Carlo Corti
2018-02-27 14:33:28 +01:00
committed by Grzegorz Piwowarek
parent ea306bec5f
commit 9801a08599
2 changed files with 169 additions and 0 deletions
@@ -0,0 +1,17 @@
package com.baeldung.java9.methodhandles;
public class Book {
String id;
String title;
public Book(String id, String title) {
this.id = id;
this.title = title;
}
@SuppressWarnings("unused")
private String formatBook() {
return id + " > " + title;
}
}