Top "Public" questions

`public` is an access-specifier in object-oriented languages; it indicates that all objects have access to the `public` field or method.

Friend declaration in C++ - difference between public and private

Is there a difference between declaring a friend function/class as private or public? I can't seem to find anything …

c++ private friend public
How to access parent class's data member from child class, when both parent and child have the same name for the dat member

my scenario is as follows:: class Parent { public: int x; } class Child:public Parent { int x; // Same name as Parent's "…

c++ visual-c++ inheritance public
How to publish ports in docker files

I need to map the ports on the host to the ports on the container. I can achieve this by …

docker port public
Objective-C static, extern, public variables

I want to have a variable that I can access anywhere by importing a header file but I also want …

objective-c static public extern
swift: declare public variable

class XYActivity: UIActivity,YouTubeHelperDelegate { var youTubeHelper:YouTubeHelper var uploadURL: String! override init() { self.youTubeHelper = YouTubeHelper() } override func activityType() -> …

ios xcode variables swift public
'public static final' or 'private static final' with getter?

In Java, it's taught that variables should be kept private to enable better encapsulation, but what about static constants? This: …

java static private public final
C# winform: Accessing public properties from other forms & difference between static and public properties

I am trying to understand whats the difference between a static and public properties. But when I tried to access …

c# winforms public
public static final variable in an imported java class

I happen to come across a Java code at my work place. Here's the scenario: There are 2 classes - ClassA …

java static final public recompile
C# public variable as writeable inside the class but readonly outside the class

I have a .Net C# class where I need to make a variable public. I need to initialize this variable …

c# variables public
Find the list of Google Container Registry public images

Where can I find the list of GCR public images? In case of docker images, we can list it in …

image list public google-container-registry