Data hiding is the way in which programmers implement encapsulation. Java™ programmers use the keywords private and protected to control what data is visible outside of a class; in other words, to control what code can access and manipulate class data.
Data Hiding
Data hiding is the way in which programmers implement encapsulation. Java™ programmers use the keywords private and protected to control what data is visible outside of a class; in other words, to control what code can access and manipulate class data.
Read Table 1-2, “Determining Access to Class Members,” in “Java – Protected Members Accessed in Derived Class
Using Base Class Instance” on the Stack Overflow website.
Note: This table is similar, though not identical, to Table 1-1, “Access Modifiers,” in Ch. 1, “Advanced Class Design,” of OCP: Oracle® Certified Professional Java® SE 8 Programmer II Study Guide.
Discuss the following by posting to the discussion area:
If Class A contains private data and Class B inherits from Class A, is it possible to make Class A’s private data visible to Class B? If so, how? Be sure to provide reasons for your answer based on this week’s textbook readings or this week’s assignment code.
DQ2 Static Variables and Methods
For this assignment, you will predict the output of Java™ code that includes a static (class) variable accessed by a static method. Completing this assignment will help you understand the utility of using static variables and methods, as well as recognize the syntax required to create static variables and methods.
Read through the linked Java™ code carefully.
Predict the result of running the Java™ code; specifically, what text you think will appear on the console after running the Java™ code. Can you think of other uses for static variables and methods? In other words, can you think of other situations in which you might want all instances of a class to be able to access a single class variable?
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
