Created
May 25, 2020 14:27
-
-
Save scorobogaci/f109af240aa855d75d7adb74b89aea5c to your computer and use it in GitHub Desktop.
GreetingsBuilder
This file contains 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
package org.example; | |
public class GreetingsBuilder { | |
private final String language; | |
public GreetingsBuilder(final String language) { | |
this.language = language; | |
} | |
public String greet() { | |
switch (language) { | |
case "EN": | |
return "Hello"; | |
case "FR": | |
return "Bonjour"; | |
case "DE": | |
return "Hallo"; | |
default: | |
return "Sorry language not supported"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment