Can we put reportCompareAll()method in RockPaperScissorDemo class instead of Roc
ID: 3658687 • Letter: C
Question
Can we put reportCompareAll()method in RockPaperScissorDemo class instead of RockPaperScissors class?
What types of change is needed for it to work? Provide your reason for why yes or why not.
Yes. But you have to make userpick and computerpick fields public instead of private under RockPaperScissors class, which will break data encapsuation rule. compareResult method should be become public access modifier also. So, its not reccomend doing so. Which also means RockPaperScissors class need to provide such method for outside to use.
this was my answer^^^ but the teacher said another answer.
plz help -___-
Explanation / Answer
first of all if you have given the code for which you are talking then i could have answered in a much better way...... well your teacher said another answer because you had not given any reason to justify your answer, instead you are just mentioning the consequences of your answer.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.