data-hiding Questions

20

Solved

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 alg...
Adorn asked 17/8, 2012 at 21:31

4

Solved

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 pu...
Adamandeve asked 14/5, 2016 at 11:47

4

Im reading this article from Crockford: http://www.crockford.com/javascript/private.html And in the section where he talks about Private, he says: Private members are made by the constructor. ...
Facilitation asked 3/2, 2016 at 10:30
1

© 2022 - 2024 — McMap. All rights reserved.