public interface Printable
Modifier and Type | Method and Description |
---|---|
default <T> T |
print(T object)
Print the supplied value to the console
|
static <T> T |
println(T object) |
default <T> T print(T object)
class MyClass implements Printable {
public void myMethod(){
Optional.of(10)
.map(i->print("optional " + (i+10)));
}
}
object
- Value to printstatic <T> T println(T object)