Sunday 15 March 2015

java- Object swaping between ReadOnly and Writable -


I am struggling with the following tasks:

Create a class person with at least the attribute Name. When the created item is in read-only mode (mistakes are allowed only) By using the method unlock, for which the password is required, the object goes into the reading / writing position. It is important that compiler checks if the object is used correctly (based on current mode). Do not use flag A reading should not be only copyable to the object.

I think I can do the last time, but I do not know how to check the compiler. Any signals?

Generic would be useful like this:

class internal professional extended public provider which has the name as a field. There is a setter for Internal Professionals but public provider is the recipient only, usually you work on public info but the unlock method will give you the Internal Professional returns the object.

Not really safe because you can always public to internal type but maybe enough for the exam?

No comments:

Post a Comment