subject

You have been given two classes, a Main. java and a Coin. java. The coin class represents a coin. Any object made from it will have a 1) name, 2) weight and 3) value. As of now, the instance variables in Coin. java are all public, and the main function is calling these variables directly for the one coin made in it. Required:
Your goal is to enforce information hiding principles in this tasl. Take Coin. java, make all instance variables private and create set/get functions for each instance variable. Then replace the direct references in main() to each instance variable with a call to an appropriate set or get function.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
The "instance" relationship shows that something is an object of a
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
How are we able to create photographs differently than 100 years ago? explain your answer in relation to your photograph you selected.
Answers: 1
question
Computers and Technology, 24.06.2019 16:50
Ramp charts are generally created in wordlotusexcelpowerpoint
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
True or false technology is often discovered by accident
Answers: 2
You know the right answer?
You have been given two classes, a Main. java and a Coin. java. The coin class represents a coin. An...
Questions
question
Mathematics, 23.12.2020 14:00
question
Mathematics, 23.12.2020 14:00
question
Social Studies, 23.12.2020 14:00
question
Mathematics, 23.12.2020 14:00
question
Social Studies, 23.12.2020 14:00