We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Although, I read tutorials and implemented the code, I dont know how it works. I mean, the family by default doesn't have senior or junior user. Which means, the familymember class don't know which method to invoke, when two parameters are passed.
I dont see any line that sets the userRole in the class as SENIOR or JUNIOR. I see the below line.
String userRole = family.userRole();
int budgetLimit = family.budgetLimit();
This is infact, setting userRole from family. the default in family is guest, so it should set userRole as Guest which will never be equal to the inputs passed.
Am I understanding something different?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Annotations
You are viewing a single comment's thread. Return to all comments →
Although, I read tutorials and implemented the code, I dont know how it works. I mean, the family by default doesn't have senior or junior user. Which means, the familymember class don't know which method to invoke, when two parameters are passed.
I dont see any line that sets the userRole in the class as SENIOR or JUNIOR. I see the below line.
This is infact, setting userRole from family. the default in family is guest, so it should set userRole as Guest which will never be equal to the inputs passed.
Am I understanding something different?