How to Fix The setter & getter ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to Fix The setter & getter ?

Please help me to finish my online learning academy. The question is as follows: TODO 1: Complete the code in the Cat class with the following provisions: -Create a Getter setter function for the Sleep property in which there is a function for printing text: The Getter/setter function is invoked -Add the code in the toSleep() function to print the text: [$name], sleep! If sleep is true and the text is: Name, let's play! If sleep is false. -------------------------------------------------------------------------------------------------------- You can change the Kotlin code that I've created to fix it in this link : https://code.sololearn.com/cOvmXL5KrVG8/#kt . Thanks. Hope your day is fun!

7th Apr 2020, 3:40 AM
Adam Fakhrul Rozi
Adam Fakhrul Rozi - avatar
2 Answers
7th Apr 2020, 3:00 PM
John Wells
John Wells - avatar
+ 1
Thank You So Much, Sir...
8th Apr 2020, 3:50 AM
Adam Fakhrul Rozi
Adam Fakhrul Rozi - avatar