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
-1
votes
1 answer

VBA Excel : share variables across modules, sheets and workbooks

i am trying to access variables across several modules, sheets and workbooks. i'm not even able to share them across modules in same workbook... i wonder what's missing. In this case, i want to open a file and then share its name across modules in…
fana it
  • 53
  • 2
  • 11
-1
votes
1 answer

How to get Public and private keys?

I have generated two files cert.pem and key.pem using OpenSSL command req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 Now I want to get public key from cert.pem file and private key from key.pem file. I have tried various methods…
-1
votes
2 answers

Why are enums in java public and static implicitly by nature?

I have been recently studying java enums and couldn't understand why they are implicitly public and static by nature. final I understand because they are constants but why the other tags?
-1
votes
2 answers

How to make a public google colab notebook for every individual users?

I would like to create a public Google Colab notebook that people can use and access that document, but I am not sure how to create a notebook that is Publically available on google collab. Can Anyone here help me to make the Public Google collab…
-1
votes
1 answer

How to make public array or list in winform

I am exercising Listbox in winforms C# and I tried to make a public array or list to use in any control, In the example I am trying to filter a listbox depending on textbox1, and it works fine, but I need to mention the array twice once in…
Csharp Newbie
  • 303
  • 1
  • 10
-1
votes
4 answers

Visual C# - Error 1 The name 'a' does not exist in the current context

private void button6_Click(object sender, EventArgs e) { for (int i = 0; i < a.Length; i++) { MessageBox.Show(a[i]); } } public void button7_Click(object sender, EventArgs e) { string[] a = { textBox1.Text}; }
Ashraf
  • 1
  • 1
-1
votes
1 answer

Google Cloud Storage Public Access

I have a question about public bucket sharing on my google platform. These are the details: 1 - I applied the public settings (adding AllUsers and AllAuthenticatedUsers to my bucket). 2 - I added some users with ObjectAdmin option so they can upload…
-1
votes
1 answer

Denied accessible config folder in yii2

So i got this yii2 project, it works fine when i open the URL with http://localhost/myproject/index.php/login/index, but when i open http://localhost/myproject/config/, http://localhost/myproject/uploads/ and http://localhost/myproject/web/access it…
Alghany Jagad
  • 239
  • 5
  • 13
-1
votes
1 answer

Is there any "public class" or "private class" in C++?

I searched it up and found out that there's no such thing as "public class" in C++ but it can be used in Java and C#. A Youtuber used a public class and the video was about some other topic so they didn't explain it. Here's the code they…
Mohsin
  • 7
  • 2
-1
votes
3 answers

Why C# public static variable doesn't need instantiation?

I am a bare-metal C, micro-controller guy who is now delving into OOP domain, starting with C# and C++. I understood that, for a member of one class to be accessible by another it has to be of the storage class static and access specifier should be…
rahulb
  • 185
  • 1
  • 9
-1
votes
1 answer

What exactly is meant by 'The data should be queried from a public accessible REST API'?

I want to build an app that should show updated corona cases worldwide. One of the instructions says that the data should be queried from a public accessible REST API. What exactly is meant by this and is it possible to achieve this with…
Meenakshi
  • 31
  • 1
  • 7
-1
votes
1 answer

Is it secure to have website files in public_html

I had a backend in Laravel and a frontend in react. Now a guy has converted my frontend to next.js. My question, I see he had put my frontend in the public folder and backend in the public folder too, Before he converts I had a folder name website…
MRVirrelli
  • 17
  • 4
-1
votes
2 answers

Trying to access my Python flask webservice from Internet, I reach the server howver it return 404 if I use 127.0.0.1 it works but not actual IP

Issue: Trying to access my webservice from Internet, call reaches the service but service returns 404, even if I try my local IP adress same issue when I use 127.0.0.1:5000 it works from flask import Flask, jsonify app = Flask(__name__) courses=…
-1
votes
1 answer

" CS0122 'Collection.Items' is inaccessible due to its protection level " but object is public

Im trying to use the Delete_Click funktion as laid out in https://stackoverflow.com/a/46898543/12955083 private void Delete_Click(object sender, EventArgs e){ lararLista.Items.Clear(); } however I get error CS0122 'Collection.Items' is…
Ramzez
  • 1
  • 4
-1
votes
1 answer

Why does this C++ data member declaration contain an ampersand?

I am a novice trying to understand some C++ code in the open-source game Simutrans. Specifically, this declaration (line 79 in this header file): class env_t { public: /// if we are the server, we are at this port ///…
Matthew
  • 156
  • 1
  • 9
1 2 3
99
100