Abstraction deals with hiding the details and showing the essential things to the user whereas encapsulation bind your data and code togethe...

Abstraction deals with hiding the details and showing the essential things to the user whereas encapsulation bind your data and code together as a single unit, or in java you can say it takes all your methods, variables and bind them together in a single class. Also, abstraction is implemented in Java using interface and abstract class while Encapsulation is implemented using private, package-private and protected access modifier. Both these OOPs concepts perform differently to reduce the complexity of the overall program. Now, let’s understand these two concepts in detail. Abstraction: It is basically the quality of dealing with ideas rather than events. Abstraction is the methodology of hiding the implementation details from the user and only providing the functionality to the users. Let’s see this real-life example of a car where i’ll help you understand what exactly abstraction is. If you consider the case of this car, here the mechanic is repairing a certain function in a car. But the user or you can say driver doesn’t want to know about these things, he just wants his car back in a working condition. So here, you basically segregate the implementation and show the other person what he actually wants to see and that exactly refers to abstraction. Encapsulation: Encapsulation in Java is a mechanism of wrapping up the data and code together as a single unit. Refer to the below image where all your methods, variables are binded together in a single class. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class.



উইন্ডোজের ১০টি ফ্রি সফটওয়্যার যা আপনার লাগবেই,1,
শিখবে সবাই - গড়বে দেশ ,সমৃদ্ধ বাংলাদেশ
শিখবে সবাই - গড়বে দেশ ,সমৃদ্ধ বাংলাদেশ
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy