I was wondering how you can have different if-else statements in java. Like if I had single and married. Would it be:
if (status == 'S' || status == 's')
{
//print your own thing here
}
// testing if the character is an upper or lowercase 'm'
else if (status == 'M' || status == 'm')
{
//print your own thing here
}
Aucun commentaire:
Enregistrer un commentaire