Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exercice1;
- import java.util.Map;
- import java.util.HashMap;
- public class Welcome {
- public static String greet(String english) {
- Map<String,String> hm = new HashMap<String, String>();
- hm.put("english", "Welcome");
- hm.put("czech", "Vitejte");
- hm.put("danish","Velkomst");
- hm.put("dutch","Welkom");
- hm.put("estonian","Tere tulemast");
- hm.put("finnish","Tervetuloa");
- hm.put("flemish","Welgekomen");
- hm.put("french","Bienvenue");
- hm.put("german","Willkommen");
- hm.put("irish","Failte");
- hm.put("italian","Benvenuto");
- hm.put("latvian","Gaidits");
- hm.put("lithuanian","Laukiamas");
- hm.put("polish","Witamy");
- hm.put("spanish","Bienvenido");
- hm.put("swedish","Valkommen");
- hm.put("welsh","Croeso");
- if(hm.containsKey(english))
- {
- return HashMap.get(english);
- }
- else
- {
- return "welcome";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement