0
java check age
Write a method called checkAge that takes in an int representing the year someone was born, and another Int representing the current year. The method should return an Int that is the person's (rough) current age age. Then overload that method with one that accepts a single int as the year someone was born and gives the current year argument a default value of 2018.
1 Respuesta
+ 2
class1
int checkAge( bornYear, currentYear )
return expression
int checkAge( bornYear )
return call first method
add class / method syntax, type for parameters, expressions, main()
+test result