BAEL-1441: Method Handles in Java 9 (#3565)
* Added MethodHandles API code * Added Reflection API example for comparison
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
ea306bec5f
commit
9801a08599
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user