Question: JAVA THEORY QUESTION RELATED TO ABSTRACTION 1a) Imagine you are building a poker game. Explain why for the poker game you should have an abstract

JAVA THEORY QUESTION RELATED TO ABSTRACTION

1a) Imagine you are building a poker game. Explain why for the poker game you should have an abstract Card class and multiple concrete subclasses for hearts, diamonds, clubs, and spades.

Answer must thoroughly explain the benefit of doing so.

b)Imagine there is a website called FunFunServer.com. Each user on FunFunServer.com is modelled with a User class. On FunFunServer.com each user is given different roles. These roles enable the user to be given special perks such as if the user has the "king" role they are able to see premium content which is hidden to those users who only have the "prince" role. Explain why having each role as a subclass of the User class is a bad idea.

Answer must thoroughly explain the disadvantages of doing so.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!