jeudi 18 août 2016

How to add two scanner strings together? in 'if' statement [duplicate]

This question already has an answer here:

I'm new to Java and I'm trying to add two strings of data together from a scanner object.

I'm wanting to say

if(age.equals("child")) AND sex.equals("male")) THEN System.out.println etc; 

This code below is all I have so far. I also have a code: sex.equals("male")

if(age.equals("child")){
        System.out.println("1. Male child shirts are on the 5th floor");
        System.out.println("2. Male child trousers are on the 6th floor");
        System.out.println("3. Male child shoes are on the 6th floor");
    }

I hope this isn't too confusing. I'm new to learning Java and only just learning the terminology.

Thanks

Aucun commentaire:

Enregistrer un commentaire