Top "Access-specifier" questions

The access specifier in an object-oriented language determines how a class restricts access to its members.

Interfaces in Java: cannot make implemented methods protected or private

I know that an interface must be public. However, I don't want that. I want my implemented methods to only …

java interface access-specifier
Inconsistent accessibility: base class is less accessible than class

So I have an abstract base class in a DLL and child classes of that class. I want the childs …

c# dll access-specifier
How to Access package private Class from a Class in some other package?

I have following classses Hello.java package speak.hello; import java.util.Map; import speak.hi.CustomMap; import speak.hi.…

java access-specifier
What is a good example to differentiate between fileprivate and private in Swift3

This article has been helpful in understanding the new access specifiers in Swift 3. It also gives some examples of different …

swift swift3 private access-control access-specifier
Java tutorial says I can have a package-private interface, but I can't

In the Java tutorial "Defining an Interface", it says If you do not specify that the interface is public, your …

java interface access-specifier
calling member functions from within another member function of the same class in C++, objective C

Consider the following: class A{ //data members void foo() { bar();//is this possible? or should you say this->bar() …

c++ function static-methods member access-specifier
Error: expected a declaration

So far all I have in my DecisionTree.h file is namespace DecisionTree { public static double Entropy(int pos, int …

c++ compiler-errors access-specifier
Why make private inner class member public in Java?

What is the reason of declaring a member of a private inner class public in Java if it still can't …

java private-members access-specifier public-members
Why can I access private variables in the copy constructor?

I have learned that I can never access a private variable, only with a get-function in the class. But then …

c++ private access-specifier
What are the differences between "private", "public", and "protected methods"?

I'm learning Ruby, and have come up to a point where I am confused. The book I am using is …

ruby access-specifier public-method