There is a hidden passport number in our Person class. Write a method passportLastDigits that will return only the last 4 digits of the passport number.
class Person(val name: String, val surname: String, private val passportNumber: String)There is a hidden passport number in our Person class. Write a method passportLastDigits that will return only the last 4 digits of the passport number.
class Person(val name: String, val surname: String, private val passportNumber: String)Sample Input 1:
Person("Bob", "Brown", 53445755)Sample Output 1:
5755Create a free account to access the full topic