Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite+ 3
I method we have given return type String but in parameters can we pass integer.
private String createCalendarEventReminder(String eventName, String location, int minutesAway) { String reminder = "You have an upcoming event in " + minutesAway + " minutes."; reminder = reminder + " It is " + eventName + " held at " + location + "."; return reminder; }
2 Réponses
+ 2
When you use this
anint + astring, the int's toString() method is called, which returns a String. reminder is a string.
0
The only overloaded operator in Java “+”