Questions tagged [public]

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

In object-oriented languages, classes specify how much access other classes can have to their members.

When a member has the public specifier, other classes have full access to that member.

Other access specifiers are protected and private.

You can use this tag for questions about how the public specifier controls (or fails to control) access to the members of a class, and questions on how it interacts with the other access specifiers.

1633 questions
0
votes
1 answer

Is it bad to set up singletons such that all methods are static methods?

I frequently setup singleton classes that are intended to be used by other programmers and I find that I'm not sure if there is a preferred way to setup access to methods in those classes. The two ways I've thought to do it are: public class MyClass…
casimps1
  • 1,749
  • 1
  • 11
  • 8
0
votes
7 answers

PHP: can an empty `index.html` 'hide' files in that directory (if the files names are not known)?

Could access to files like df9dfglh_56_ghf.mp3 in /www/pub/ prevented with an empty index.html file? (but giving access via index.php with login to a database that then links to that file name)? UPDATE: but I would rather NOT restrict access to the…
ajo
  • 1,045
  • 4
  • 15
  • 30
0
votes
1 answer

public variable

I want to make a variable that can be accessed by all classes that I have made. How do I do this? I have tried by stating in the mainwindow header file: public: extern int number; And then referencing to this in other classes by…
Frank
  • 2,446
  • 7
  • 33
  • 67
0
votes
1 answer

Public function not working properly

I have the following two pieces of code, please take a look at it, I pointed where it is going wrong. I removed the functions where I call the second window, they do not make sense here. First, main form, this form calls the second form: using…
2pietjuh2
  • 879
  • 2
  • 13
  • 29
0
votes
1 answer

Node.js - Dynamically forbid some public paths on production mode

I'm using node.js with express.js. Here's my public dir structure: public/ js/ css/ images/ built/ main-built.js main-built.css index.html dev.html Where index.html links to scripts in js/ and css/, while…
Trantor Liu
  • 8,770
  • 8
  • 44
  • 64
0
votes
1 answer

public nested classes inheriting from protected nested classes?

In order to implement my own iterators, I would like to implement something like this : class MyClass : { public: class MyIterator1 {;}; class MyIterator2 {;}; class MyIterator3 {;}; }; As these iterators will share some…
Vincent
  • 57,703
  • 61
  • 205
  • 388
0
votes
1 answer

How to make a public method in jQuery Plugin

I've been using the below boilerplate for jQuery Plugin development which has been working great. But I'm not sure of the best way to make a "method" public. ;(function ( $, window, undefined ) { var pluginName =…
Pardoner
  • 1,011
  • 4
  • 16
  • 28
0
votes
1 answer

Creating public synonym at system level

I have created public synonym as suggested in my other question about creating view at system level. Having said that I have created individual public synonym out of the view so that I don't have to connect to the individual domain anymore. My…
Fadzil
  • 83
  • 1
  • 4
0
votes
3 answers

Using variables to refer to array indices in C#

I'm working on some C# code where I have several files that use the same public variables (let's call these variables a, b, and c for now). Disclaimer: please don't berate me on the quality of the code, I didn't write it, it's simply my job to fix…
0
votes
4 answers

Regarding accessing the protected method

There is a project named demo which consists of two packages, named aa and bb. In package aa I have a public class One which has a method with protected as a modifier. Now in the other package bb , I have a public class two which wants to access the…
user1582269
  • 285
  • 1
  • 6
  • 12
0
votes
3 answers

Set public value in an object using PHP

I want to set my value in object using public method. But I can't find to make it work $id = "1"; } } …
Robin Carlo Catacutan
  • 13,249
  • 11
  • 52
  • 85
0
votes
3 answers

What if, a public key was stored on the server?

The public key and private key pairs are created on the client side via a java script algorithm and the public key is then transferred over to the Server. A copy of the persons private key was stored on the users computer in the form of a java…
Ere
  • 3
  • 2
0
votes
1 answer

Facebook API for extracting basic(Public) profile info of a person

Actually I want to extract basic(Public Profile) information of a person on Facebook by it's name or email-ID without any type of authentication. So, can anyone tell me the detailed procedure how i can acheive this using Java Programming and i want…
0
votes
1 answer

ActionScript 3 Public MovieClip

I've dynamically created a menu using MovieClips as menu items inside a public function, but I also need to access these MovieClips on the timeline, however using similar code as below works for initially creating them, but not accessing them on the…
0
votes
1 answer

Access a web service from a different network

A simple description of our architecture for the school project we are doing: -we have a data warehouse to compile data from all clients -clients are using a locally deployed web application. Each client would have a local web application for it to…
panda8910
  • 13
  • 1
  • 3