Question 12

There are numbers in between 0-9999999999 (10-digits) which are assigned someone (does not matter which number assigned who)
Write two methods called “getNumber” and “requestNumber” as follows
Number getNumber();
boolean requestNumber(Number number);
getNumber method should find out a number that did not assigned than marks it as assigned and return that number.
requestNumber method checks the number is assigned or not. If it is assigned returns false, else marks it as assigned and return true.
Design a data sturucture to keep those numbers and implement those methods.

[advanced_iframe securitykey=”undefined” src=”” width=”100%” height=”600″]

Register for the new batch at KodNest and start your journey to success.Secure Your Spot Now!Claim Your Seat

Request A Callback

Get a Free 30-minute Counseling session with our experts.