n? What happens if data is not encapsulated within a class? Is there a way to access data which is encapsulated in a class? Give examples to encapsulate data within class and package.   There is an online banking system where a user can view his contact info, account summary, add few beneficiaries account details. The bank officer can also view user's contact info, account summary, ATM card charges, bank charges, and other deductions. Create a class Customer and define its attributes and method

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter12: Event-driven Gui Programming, Multithreading, And Animation
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question

Why do we need encapsulation? What happens if data is not encapsulated within a class? Is there a way to access data which is encapsulated in a class? Give examples to encapsulate data within class and package.

 

There is an online banking system where a user can view his contact info, account summary, add few beneficiaries account details. The bank officer can also view user's contact info, account summary, ATM card charges, bank charges, and other deductions. Create a class Customer and define its attributes and method names with proper access modifiers i.e. public, private or default.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT