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 to access an object's public fields from a Velocity template

Here is my object class: public class Address { public final String line1; public final String town; public final String postcode; …

java field velocity public vtl
C# override public member and make it private

Possible? Can you change the access of anything to anything else?

c# .net overriding private public
Does static method in PHP have any difference with non-static method?

class t { public function tt() { echo 1; } } t::tt(); See?The non-static function can also be called at class level.So …

php static public
Java - Method accessibility inside package-private class?

If I have a java class which is package-private (declared with "class", not "public class"), there is really no difference …

java class methods accessibility public
CakePHP "Fatal error: Class 'Debugger' not found" in a File That Doesn't Reference Debugger

I'm getting the error referenced in the title from a file that doesn't reference the Debugger class. If I manually …

php cakephp-2.0 public
How to prevent public methods from being called from specific classes

I have an existing class into which I want to add a method. But I want the method to be …

java class public
javascript private function access public variable

i have this class: function ctest() { this.var1 = "haha"; this.func1 = function() { alert(this.var1); func2(); alert(this.var1); } var …

javascript class private public
c# abstract methods: internally public and virtual?

Are abstract methods internally public and virtual in c#? All methods are, by default, private and if an abstract method …

c# abstract-class private public access-modifiers
What is the difference between 'open' and 'public' in Kotlin?

I am new to Kotlin and I am confused between open and public keywords. Could anyone please tell me the …

kotlin keyword public
How to use Unit files in Delphi

I'm just trying to get the hang of separate units to make my code more encapsulated. I'm trying to get …

delphi private pascal public delphi-units