Search:

Type: Posts; User: PhHein

Search: Search took 0.10 seconds.

  1. Thread: Morse Code

    by PhHein
    Replies
    14
    Views
    1,530

    Re: Morse Code

    No, the loop is implemented in in that Translate class. I'd change the logic though. In your Translate class you could read the file in a static initializer block and provide a static method :
    ...
  2. Thread: Morse Code

    by PhHein
    Replies
    14
    Views
    1,530

    Re: Morse Code

    The original is sentence and the morse is morse.getSentence() .I have no idea what that for loop is good for and why you need char[] c.
  3. Thread: Morse Code

    by PhHein
    Replies
    14
    Views
    1,530

    Re: Morse Code

    You still haven't posted, what the expected output is. And why do you read the file without ever using anything from it?
  4. Thread: Morse Code

    by PhHein
    Replies
    14
    Views
    1,530

    Re: Morse Code

    You seem to use other code than that you've posted. What happened to the file reading, which is more than buggy?
  5. Thread: Morse Code

    by PhHein
    Replies
    14
    Views
    1,530

    Re: Morse Code

    There's no need to test. No Scanner instance is out of scope. Both are defined in the main method outside of other code blocks. That's why your answer is wrong.
  6. Thread: Morse Code

    by PhHein
    Replies
    14
    Views
    1,530

    Re: Morse Code

    Wrong!
    The OP didn't state what his actual problem is. He's wildly mixing Strings and chars, file and input all over the place.
  7. Thread: Morse Code

    by PhHein
    Replies
    14
    Views
    1,530

    Re: Morse Code

    What is strange? Do you get Greek characters? Help us help you by posting what you get and what you expect.
Results 1 to 7 of 7