So I wrote code where you enter someone's first name, last name and whatnot and their age. Then someone ele's first name and so on. Then I wanted to compare their ages so I wrote
if (age != age2){
System.out.println (firstName + "is the same age as" + firstName);
}else{
System.out.println ( "They are different ages");
}
}
That tells me that they're the same age which is fine. However, I want to add something where it compares age to age 2 and comes back with "is 22 years older than" and so on. I'm not sure how to do this and I've looked all around and not found things on how to do this.