Q:

Converting String[] to String in Java Eclipse

The objective: Create a program that responds to the "sysout" of the first RNG produced results.
The last two lines are the problematic lines.
The code thus far: 
    import java.util.Random;

public class Tutorials {

public static void main(String[] args) {
String[] test = new String [3];
test[0]= "go";
test[1] = "stop";
test [2] = "slow";
System.out.println(test [new Random ().nextInt(test.length)]);
if (test="stop") { System.out.println("wait 3 seconds");}   
}

}

A:

You are trying to assign a String to String array in this line if (test="stop"). To perform the check it needs to be == not =. But when doing String comparision try to use .equals() instead of the == operator, more info about == vs .equals()
Solution
public class Tutorials {

   public static void main(String[] args) {
       String[] test = {"go", "stop", "slow"};
       String result = test [new Random().nextInt(test.length)];
       System.out.println(result);

       if (result.equals("stop")) { 
         System.out.println("wait 3 seconds");
       }   
    }
  }

