Click here to Skip to main content
15,886,689 members
Everything / Encapsulation

Encapsulation

encapsulation

Great Reads

by Marco-Hans Van Der Willik
This article continues with the development of the SOLID Poker project, and covers functionality to Compare and Validate Poker Hands.
by Maxim Komlev
Task Scheduler JavaScript library
by Shawn Lawsure
Implementing modularization and encapsulation in JavaScript
by RPGillespie
Generate a quick pcap file with a custom packet

Latest Articles

by Shawn Lawsure
Implementing modularization and encapsulation in JavaScript
by Marco-Hans Van Der Willik
This article continues with the development of the SOLID Poker project, and covers functionality to Compare and Validate Poker Hands.
by Marco-Hans Van Der Willik
There are a surprising number of variations on poker rules, making poker an excellent candidate for a SOLID Project, a project illustrating SOLID Principles and related Patterns & Practices.
by _Ankit_Singh_
There are 4 fundamentals ideas of Object Oriented Programming. They have the wonderful terms – Abstraction, Polymorphism, Inheritance, Encapsulation. One way to remember these is the acronym APIE. Let’s dive in each of them one by one.

All Articles

Sort by Score

Encapsulation 

7 Apr 2017 by Marco-Hans Van Der Willik
This article continues with the development of the SOLID Poker project, and covers functionality to Compare and Validate Poker Hands.
22 Jan 2015 by BillWoodruff
I think you are struggling, as many newcomers to C# and OOP do, with trying map big-picture concepts/outcomes of implementing what you might call "general OOP philosophy" to actual C# code objects you program with.In my experience students often start C# with a general sense that OOP is...
11 Sep 2015 by PIEBALDconsult
I suspect that if (_mark
13 Mar 2012 by Sander Rossel
Recently I have been developing some WinForms Controls for my company. Sometimes I inherit an already existing control and sometimes it's a composite control with different other controls on it. However, I have a problem, or rather a question.Now my problem lies in how to properly encapsulate...
16 Mar 2012 by Sergey Alexandrovich Kryukov
OK, let's start from some example, but first of all, I want to have the techniques of delegation or events to a host control which would work not only with Forms, but also with WPF, and, more generally, in all cases where you have composed event-enabled members which should remain private. I...
21 Jan 2015 by Zoltán Zörgő
Ok, you were not quite efficient in googling :)Encapsulation[^] is quite what you have drafted: hiding from the class "user" what's not his concern. If I implement a class that represents a polynom, don't let the user uf my class mess around with the array storing the coefficeints. And so...
3 Oct 2017 by Shawn Lawsure
Implementing modularization and encapsulation in JavaScript
27 Jun 2013 by RPGillespie
Generate a quick pcap file with a custom packet
12 Sep 2013 by J Melkerson
The following snippet of code contains two nested try blocks that try to find information in table "a", and if that fails, tries to find the same info in table "b". The two 'try's are identical except for the table that is queried and the value assigned to 'whereFound'. I know I need to...
11 Aug 2016 by Richard MacCutchan
You are not accessing the private property directly, but using a 'getter' to return it from the class. This is the correct way to do it, by calling getModel.
15 Feb 2018 by User98743
I'm struggling to understand how to implement principles of encapsulation, inheritance and polymorphism to break this code into logical parts. My background is in VBS/Classic ASP and database development, not OOP. I'm not asking anyone to write the code, but rather to point me in the right...
14 Feb 2018 by #realJSOP
Inheritance (C# Programming Guide) | Microsoft Docs[^]
15 Feb 2018 by Afzaal Ahmad Zeeshan
Apart from what Solution 1 has, I would also recommend keeping all the classes separate in their own specific files. Other than that, this can be easily converted to two separate classes; database connection management, database connection helpers (check if file or DBMS etc.). But that has to...
29 Jul 2018 by OriginalGriff
Quote: I have just done a lot of typing and backspacing, inputting a bunch of different things to try to make it work. And there is your problem. Stop typing. No, seriously - stop typing. Start thinking instead. Look at the rules, and work out what they require you to do when you play. Then get...
29 Sep 2018 by Member 14002280
I have this one particular questions where it about encapsulation. So i declared few private variables and created getter method as I use it later but for the setter method, I do not need to use it as for now I do not need to update anything. I just want to get confirmation from you guys as I do...
29 Sep 2018 by OriginalGriff
Getters and Setters have nothing to do with encapsulation, it has to do with protecting direct access to variables, so that they can't be changed unless the class is aware of it. It isn't necessary to have both a getter and a setter: you can have either one without the other, and there are...
4 Mar 2021 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
13 May 2021 by OriginalGriff
Quote: How can I solve this problem By learning about inheritance and encapsulation in Java, and then using that knowledge to produce code. We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it...
13 May 2021 by Patrice T
Quote: How can I solve this problem I would start by learning the topics. Having us doing your homework will not help you to learn any thing, it will only make next lessons harder and harder. If you really want to get the job of programmer, one...
13 May 2021 by Richard MacCutchan
Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)[^]
11 Aug 2016 by User 10233200
sir when we un-comment the getModel method in child class and execute it dispaly error private property can not access in child but in get_Display method same propety is access how is it possible or i m making a mistake? class Tv{public $volume;private $model; function...
30 Mar 2017 by Marco-Hans Van Der Willik
There are a surprising number of variations on poker rules, making poker an excellent candidate for a SOLID Project, a project illustrating SOLID Principles and related Patterns & Practices.
26 Nov 2015 by _Ankit_Singh_
There are 4 fundamentals ideas of Object Oriented Programming. They have the wonderful terms – Abstraction, Polymorphism, Inheritance, Encapsulation. One way to remember these is the acronym APIE. Let’s dive in each of them one by one.
13 Mar 2012 by Sergey Alexandrovich Kryukov
I think the way of exposing an event of a ControlChild to the interface of ControlHost you have described as "a lot of work" is the most appropriate.Perhaps you can do a little better using the following technique: you can create some interfaces representing each of the nested controls and...
24 Mar 2014 by Keyhole Software
Encapsulation approach to bring data sources and implementations closer together, allowing reflection-like behavior in a format that mere mortals can read.
30 Jul 2018 by User 13897807
Testing! New to this site and want to see how it works! What I have tried: Giving this a try!
21 Jan 2015 by Safari137
I just spent a long while on Google trying to figure this out and want to make sure I have it right.Encapsulation is hiding data that another programmer of different classes should not be able to directly access.Abstraction is only making available the methods and features that are...
17 Dec 2014 by voronitski.net
Hi everybody,So i have : class Personne implements Cloneable...The personne class uses Adress class in it's field. private Adresse adresse=ADRESSE_UNKNOWN;So what i want is having a option to : modify the cloned Person adress BUT that the original Person...
17 Dec 2014 by voronitski.net
Ok Guys , so with help i understood. The possibility to override a clone() method is giving the opurtunity to modify the fields of the cloning class. As a proposed solution a reset the Adress field of the class to NULL. Then i created a setter that giving an option to modify the clone adress...
11 Sep 2015 by dinesh_redhawk
Hello Friends,I am not able find out the problem in this code.My output should be - when i pass the value of Mark as 1 it should return 0 and when i pass as 20 , it should return 20 (via the property 'Mark'). But currently its returning only 0,0 in all cases.Please help. class...