+ 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 Answers
+ 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 â+â