How toString method work ?
After s.put(String,Cat)
here how Cat return Name
i can't understand
please any one can explain?
i can't understand?
Resolved
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
hidden #10522353
18 March 2020, 13:23
return name != null ? name.toUpperCase() : null;
it is the same :
if (name != null) { // if name is not null
name.toUpperCase(); // name is written using BIG LETTERS
return name; // return name
}
else { return null;} // otherwise return null
There is a lesson somwhere in code Gym about trenary operator:
booleanExpression ? expression1 : expression2
0