Write a Java program to demonstrate the use of an interface for custom message formatting
interface MessageFormatter { String format(String message); } public class Main { public static void main(String[] args) { MessageFormatter formatter = message -> "Formatted Message : " + message; String originalMessage = "Hello Wrold! 123"; String formattedMessage = formatter.format(originalMessage); System.out.println(formattedMessage); } }
Formatted Message : Hello Wrold! 123
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions