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
0 answers

Is it safe to allow python.exe to communicate on public and private networks? (Windows Firewall)

TLDR: Is allowing python.exe to communicate on public networks in a coffee shop potentially putting me and my computer at risk? If so, what risk? Hi everyone, first question here. I am curious what to do when Windows Firewall asks me what networks…
-1
votes
2 answers

Implement interface without publicly exposing property setter?

The sample code below better explains my issue, its well explained in the comments. Browser contains various implementers of BrowserModule, these modules have a reference to the owner Browser so they can work together internally. Each "main" module…
Joao Vitor
  • 169
  • 1
  • 9
-1
votes
1 answer

WinError 10049 socket won't work with public ip Python3

I was having my first few tries with sockets but I kind of stuck here: I really don't understand why sockets will work only with private ip's here's the code: import socket s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) …
CodEdo
  • 91
  • 2
  • 9
-1
votes
2 answers

Do values initialized in brackets override those set in C# constructor?

Can someone explain how I would add the GENERATED notifications inside the C# class constructor, if an initial list is started in the code that is creating the new class. Is Notifications = notificationsPASSEDList only run after the…
SweetTomato
  • 509
  • 1
  • 6
  • 16
-1
votes
4 answers

Is there a way to call a public int from another class?

Is there a way to use a non static public int in another class? I want to have classes where I have useful functions and static information that I use in many other classes in different packages. info.longrandom Does not work because it is non…
Ragatokk
  • 163
  • 1
  • 11
-1
votes
1 answer

How to attach image path on getting data from database using laravel

I am getting data from database and i have a field profile_pic and i am saving image name in my database my response looks like: "basicInfo": { "id": 205, "first_name": "new name", "middle_name": "middle", "profile_pic":…
syed1234
  • 761
  • 5
  • 12
  • 30
-1
votes
1 answer

How to delete old images from public folder on update using Laravel

I want to delete older images in public folder on update: My Controller code: try { $path = public_path('profile_images'); @mkdir($path, '0777', true); $image = base64_decode($image); $imageName = str_random(10).'.'.'png'; …
syed1234
  • 761
  • 5
  • 12
  • 30
-1
votes
1 answer

How to pass dynamic variables to another form?

I have two Forms Form1 and Form2, both of them are already "connected" with eachother. I am already passing button signals, trackbar values, timer ticks..., between them. The connections looks like this inside Form1: private void Form1_Load(object…
-1
votes
1 answer

How to properly make variable Public so it can be accessed by another script?

In Unity I have 2 GameObjects, a sphere and a capsule. And I have a script attached to each. Capsule script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class CapsuleMesh : MonoBehaviour { public Mesh…
m0a
  • 1,005
  • 2
  • 15
  • 29
-1
votes
2 answers

How To Make public sub form ShowDialog

How To Make public sub form ShowDialog I have Module and i want to put a code that i can use it in all project to open forms . I have Tried to put this code in Module Put Not Working Public Sub OpenForm(ByVal Frm As Form) Frm = New Frm() …
Salem
  • 87
  • 1
  • 2
  • 7
-1
votes
1 answer

please explain every element of Java main ("public static void main(String[] args)")

Explain Java main method? 2.Why main is always public in Java? 3.why main is always static? 4.why main always accepts String array as argument? 5.can we overload main method in java? can we override main method in java? Please explain in detail
-1
votes
1 answer

Are the init methods of a static final object called again and again when I use that object?

I have a library, in which I need only one configuration all through the app. I call a method in that library through a public static final reference in a Helper class to the library' s builder. Schematically, it looks like this: public class…
Eugene Kartoyev
  • 501
  • 4
  • 11
-1
votes
1 answer

the name '' does not exist in the current context

Hi I can't fix the issue in OnLoginSuccess() pubSocket.SendMoreFrame("TopicA").SendFrame("Hello"); variable due to error the name '' does not exist in the current context. I know that I need to change variable to public but when I add static public…
sortedMAn
  • 3
  • 2
-1
votes
1 answer

laravel videos not in the public folder

I have a laravel application (5.4) Every user has a folder under /public where the admin can upload (via FTP) some videos for the users to see. Every user have different Videos. The problem i have now is, that everything in the public folder is…
hatemjapo
  • 800
  • 3
  • 8
  • 30
-1
votes
1 answer

Github Pages React App index.html file not in root

I have researched extensively and have not been able to find an answer to this issue. I’m thinking it might still not be solved! Is there any way to change the path of a React app (in webpack) so that the index.html file can be in the root, and not…
sxiong
  • 9
  • 1
1 2 3
99
100