data-hiding

Does 'Encapsulation' help develop multiple modules parallely?

廉价感情. 提交于 2020-01-16 20:18:23
问题 After going through SO questions, I learnt that, Encapsulation is about protecting invariants and hiding implementation details. Abstraction has to do with separating interface from implementation . From class room java training, I learnt that, Encapsulation has following advantages, Why encapsulation is your friend? [1] The implementation is independent of the functionality. A programmer who has the documentation of the interface can implement a new version of the module or ADT independently

Hiding C struct definition

陌路散爱 提交于 2020-01-13 20:28:34
问题 Here is my setup: In public.h: #ifndef PUBLIC_H_ #define PUBLIC_H_ #include "func.h" /*extern typedef struct _my_private_struct PRIVATE_;*/ typedef struct _my_private_struct PRIVATE_; /* Thanks to larsmans and Simon Richter */ #endif In struct.h #ifndef STRUCT_H_ #define STRUCT_H_ struct _my_private_struct { int i; }; #endif In func.h: #ifndef FUNC_H_ #define FUNC_H_ #include "struct.h" /* typedef struct _my_private_struct PRIVATE_; */ extern PRIVATE_ * get_new(int); #endif In func.c:

Google Sheets: Hiding Columns based on date in row 1

丶灬走出姿态 提交于 2019-12-31 05:12:10
问题 I have no experience with scripting in Excel or Google Sheets, so I'm trying to branch out a bit and see if there's a solution to my problem. We use Google Sheets for a weekly calendar at our kitchen remodeling business. We organize the weeks from left to right and list the jobs we're currently working on in those columns. I would like to automatically hide all columns that have a date older than 4 weeks, so when the sheet opens, we're not starting with a date from a year ago. I can hide

JAVA - Abstraction

孤人 提交于 2019-12-19 10:52:41
问题 I am little confused about abstraction in java. I have checked many pages stating that abstraction is data hiding(Hiding the implementation). What I understand about abstraction is it is 'partial implementation'. Just define what you are going to need in an abstract class/interface and afterwards extend/implement them and add your own functionality. What I don't understand is how this is a data hiding? You are going to get access to the code once you implement the class/interface and you will

JAVA - Abstraction

筅森魡賤 提交于 2019-12-19 10:52:09
问题 I am little confused about abstraction in java. I have checked many pages stating that abstraction is data hiding(Hiding the implementation). What I understand about abstraction is it is 'partial implementation'. Just define what you are going to need in an abstract class/interface and afterwards extend/implement them and add your own functionality. What I don't understand is how this is a data hiding? You are going to get access to the code once you implement the class/interface and you will

Are static variables inherited

烂漫一生 提交于 2019-12-17 06:49:14
问题 I have read at 1000's of locations that Static variables are not inherited. But then how this code works fine? Parent.java public class Parent { static String str = "Parent"; } Child.java public class Child extends Parent { public static void main(String [] args) { System.out.println(Child.str); } } This code prints "Parent". Also read at few locations concept of data hiding. Parent.java public class Parent { static String str = "Parent"; } Child.java public class Child extends Parent {

data hiding in C++

£可爱£侵袭症+ 提交于 2019-12-08 07:19:09
问题 I have some code in C, that uses incomplete structs this way ( simplified example ): something.h struct something; struct something *new_something(); int work_a(struct something *something); int work_b(struct something *something, const char *str); void free_something(struct something *something); somecode.c int some_function() { struct something *something; int x; something = new_something(); x = work_a(something); free_something(something); return x; } I was thinking, I'm basically doing C+

Google Sheets: Hiding Columns based on date in row 1

≡放荡痞女 提交于 2019-12-02 09:36:32
I have no experience with scripting in Excel or Google Sheets, so I'm trying to branch out a bit and see if there's a solution to my problem. We use Google Sheets for a weekly calendar at our kitchen remodeling business. We organize the weeks from left to right and list the jobs we're currently working on in those columns. I would like to automatically hide all columns that have a date older than 4 weeks, so when the sheet opens, we're not starting with a date from a year ago. I can hide these columns manually each week, but when I do need to go back and look at previous weeks, I'm forced to

JAVA - Abstraction

主宰稳场 提交于 2019-12-01 12:30:30
I am little confused about abstraction in java. I have checked many pages stating that abstraction is data hiding(Hiding the implementation). What I understand about abstraction is it is 'partial implementation'. Just define what you are going to need in an abstract class/interface and afterwards extend/implement them and add your own functionality. What I don't understand is how this is a data hiding? You are going to get access to the code once you implement the class/interface and you will modify it according to your need. I have checked many questions, articles on this but still confused

Encapsulation vs Data Hiding - Java

跟風遠走 提交于 2019-11-27 17:17:34
Interviewer: What is encapsulation and how do you achieve it in Java? Me: Encapsulation is a mechanism to hide information from the client. The information may be data or implementation or algorithm. We achieve this using access modifiers. Interviewer: This is data hiding. How do we achieve encapsulation in Java? Me : uummmm Concrete Question: Other than 'Access Modifiers', what is the way to implement Encapsulation in Java? More generally encapsulation refers simply to bundling the data (e.g. of an object) with the operations on that data. So you have a class encapsulating data - fields -