Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.HashMap;
import java.util.Map;

public class Main {
    private static Map<String, String> morseToCharTable = new HashMap<String, String>();

    public static char getCharForMorse(String morse) {
        String out = morseToCharTable.get(morse);
        if (out != null) {
            return out.charAt(0);
        } else {
            return '?';
        }
    }
}