import java.util.Random;
public class teststring {
public static void main(String[]args){
Random RG = new Random();
String[] fruit = {"I am not your friend", "oh, yeah"," Think again"};
fruit = RG.getRandom();
System.out.println(fruit);
}
}
Anyone know what i am missing? i want to have the code randomly return one of those text from that parameter
Question
GreenInspiration
import java.util.Random; public class teststring { public static void main(String[]args){ Random RG = new Random(); String[] fruit = {"I am not your friend", "oh, yeah"," Think again"}; fruit = RG.getRandom(); System.out.println(fruit); } }Anyone know what i am missing? i want to have the code randomly return one of those text from that parameter
Link to comment
Share on other sites
1 answer to this question
Recommended Posts