jeudi 10 septembre 2020

How can one use java statements to get indexes from string arrays of string arrays to print a statement?

public static void main (String[] args) throws java.lang.Exception{
    ArrayList friends = new ArrayList<>(asList("Danny", "Benni", "Marcus", "Pat"));
    ArrayList Places = new ArrayList<>(asList("Paris", "Brasil", "Miami", "Jamaica"));
    ArrayList Gifts = new ArrayList<>(asList("Snacks", "Photos", "Instrument", "Whine"));
    
    ArrayList[] travelgoals = new ArrayList<>{Places, Gifts};
    
    for (int b = 0; b > friends.length; b++){
        if(b > Places.length) {
            System.out.println(Places.get().Random((0), Places.length);
        }if (b > Gifts.length) {
            System.out.println(Gifts.get().Random((0), Gifts.length);
        }
    }else {
        System.out.println("Looks like you got off scottfree!");
    }
}

Hello I'm trying to use string arrays to print random goals in locations though I think I'm more than way off.




Aucun commentaire:

Enregistrer un commentaire