Java. Using drjava compiler gives me an error than no other compiler gives me

import java.io.*;

import java.util.*;

public class GentCanadian

{

public static void main (String[] args) throws IOException

{

BufferedReader objReader = new BufferedReader (new InputStreamReader (System.in));

String lowerInput = ""; // declaring variable to work outside the loop

while (!lowerInput.equals("quit"))

{

System.out.print ("Please enter a sentence to translate (Enter 'quit' to leave)");

String input = objReader.readLine ();

lowerInput = input.toLowerCase(); // any form of "quit" will make the loop exit

Translate newSentence = new Translate(input);

String output = newSentence.getOutput();

System.out.println (output); // printing output

}

}

}

class Translate

{

// declaring variables

private String word = "";

private String newWord = "";

private String line = "";

private String output = "";

private char lastLetter;

private...

Read More »

By: StackOverFlow - 5 days ago

Related Posts