Created
May 9, 2025 14:38
-
-
Save rrrlibra/23194ea95a9b0c0d95cf2c1968942ce2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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