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.

How do I make an Rust item public within a crate, but private outside it?

I have a crate that has lots of code, so I've split it into multiple files/modules. However, some modules …

module rust public rust-crates
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
Swift 3: The difference between Public and Internal access modifiers?

I read the Apple's reference about access modifiers in Swift 3. I read also about the same on stackoverflow but I …

swift oop inheritance public internal
protected vs public constructor for abstract class? Is there a difference?

This question is out of curiosity. Is there a difference between: public abstract class MyClass { public MyClass() { } } and public abstract …

c# constructor public protected
C++ why use public, private or protected inheritance?

Well there is enough information about this subject. For example this thread was very clear to me: Difference between private, …

c++ inheritance private public protected
How to setup public git repositories?

I recently tried to setup git repo on a linux box and wasted about 10 hours with absolutely no results. There …

git repository public
Can't access protected member in base class from derived class

Heres my code : #include <iostream> #include <cmath> #include <sstream> using namespace std; class root { …

c++ public protected inheritance
C++: overriding public\private inheritance

If B inherits from A using public, can B override one of the functions and force it to be private? …

c++ inheritance private public
Can there be two public section in a class? If yes then why ? And in which circumstances we do so?

There is something bugging me about classes. For example class A { public: A() { ..... ..... } void cleanup() { .... .... .... } public: UINT a; ULONG b; }; …

c++ class public
Assign LAN IP address to Docker container different from host's IP address

Am not well versed with Unix networking, adding virtual interfaces etc, trying to learn it now. We are trying to …

docker ip port containers public