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.

What is the difference between public, protected, package-private and private in Java?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, …

java private public protected access-modifiers
What is the difference between public, private, and protected?

When and why should I use public, private, and protected functions and variables inside a class? What is the difference …

php oop private public protected
Is it possible to declare a public variable in vba and assign a default value?

I want to do this but it won't compile: Public MyVariable as Integer = 123 What's the best way of achieving this?

vba variables default-value public variable-declaration
C# Foreach statement does not contain public definition for GetEnumerator

I'm having a problem with a Windows Form application I'm building in C#. The error is stating "foreach statement cannot …

c# definition public enumerator
Call-time pass-by-reference has been removed

Possible Duplicate: Call-time pass-by-reference has been deprecated While it may be documented somewhere on the internet, I cannot find a …

php class function pass-by-reference public
Setting public class variables

How do I set a public variable. Is this correct?: class Testclass { public $testvar = "default value"; function dosomething() { echo $this-&…

php variables public
How to declare Global Variables in Excel VBA to be visible across the Workbook

I have a question about global scope and have abstracted the problem into a simple example: In an Excel Workbook: …

excel module global-variables public vba
Difference between public static and private static variables

class Employee{ // salary variable is a private static variable private static double salary; // DEPARTMENT is a constant public static final …

java variables static private public
How to write a simple class in C++?

I have been reading a lot of tutorials on C++ class but they miss something that other tutorials include. Can …

c++ constructor destructor public private-members
Why does Typescript use the keyword "export" to make classes and interfaces public?

While dabbling with Typescript I realised my classes within modules (used as namespaces) were not available to other classes unless …

typescript module public access-modifiers