Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rrrlibra/23194ea95a9b0c0d95cf2c1968942ce2 to your computer and use it in GitHub Desktop.
Save rrrlibra/23194ea95a9b0c0d95cf2c1968942ce2 to your computer and use it in GitHub Desktop.
public class StringModifierDemo {
public static void main(String[] args) {
StringModifier stringModifier = s -> s.toUpperCase() + "!";
String stringFirst = "aaaaa";
String stringLast = stringModifier.modify(stringFirst);
System.out.println(stringLast);
}
}
@FunctionalInterface
interface StringModifier {
String modify(String s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment