Top "Private" questions

Private is a way of encapsulation in object-oriented programming.

Package private modifier in Scala 2.8

If I try private[com.company.foo] def bar(xml: XmlPath) = { I get [error] ... ']' expected but '.' …

scala package private
Private constructor in abstract class

In Java what is the purpose of using private constructor in an abstract class? In a review I got this …

java class constructor private abstract
Why would a virtual function be private?

I just spotted this in some code: class Foo { [...] private: virtual void Bar() = 0; [...] } Does this have any purpose? (I am …

c++ private virtual-functions access-specifier overriding
Closest Ruby representation of a 'private static final' and 'public static final' class variable in Java?

Given the Java code below, what's the closest you could represent these two static final variables in a Ruby class? …

java ruby static private public
Private or Public MSMQ

We are using Queue for few of are WCF services. We are using NetMSMQ binding for the WCF services which …

msmq private
Private interface methods, example use-case?

"Support for private methods in interfaces was briefly in consideration for inclusion in Java SE 8 as part of the effort …

java interface private java-9
C++: Why must private functions be declared?

Why do classes in C++ have to declare their private functions? Has it actual technical reasons (what is its role …

c++ class function private declaration
Public property VS Private property with getter?

This question has puzzled me for a while. A public property that can be accessed directly or a private property …

java properties private public getter
Private members when extending a class using ExtJS

I have done some research on the ExtJS forum regarding private methods and fields inside a extended class, and I …

javascript extjs private extend private-members
Is there a way to make Rails ActiveRecord attributes private?

By default, ActiveRecord takes all fields from the corresponding database table and creates public attributes for all of them. I …

ruby-on-rails activerecord private