I am working on an assignment converting English to Pig-latin. I am trying to get a word to go if the first letter is a then java should print the whole word. When i type in apple it prints apple but if i put in cool it also prints out cool.
import java.util.Scanner;
import javax.swing.JOptionPane;
public class Assignment_4_Piglatin{
public static void main(String[] args){
Scanner userWord = new Scanner(System.in);
System.out.println("K. Caleb Swallow");
System.out.println("Welcome to the Pig Latin Translator!");
boolean run = true;
while(run){
System.out.println("Please enter a word(or press Q to quit):");
String firstLetter = "something";
String word = userWord.next();
System.out.println(word);
firstLetter = Character.toString(word.charAt(0));
String color = word;
if( firstLetter == "a"){
System.out.println(color);
}