Questions tagged [protected]

`protected` is an access specifier in object-oriented languages. When the members of a class are `protected`, there is restricted access to these members for other classes.

The protected keyword specifies access to class members in the member-list up to the next access specifier (public or private) or the end of the class definition. Class members declared as protected can be used only by the following:

  • Member functions of the class that originally declared these members.
  • Friends of the class that originally declared these members.
  • Classes derived with public or protected access from the class that originally declared these members.
  • Direct privately derived classes that also have private access to protected members.
  • In the Java language, classes in the same package as the class that originally declared these members.
1204 questions
-1
votes
3 answers

How to choose between private and protected access modifier to encapsulate members between base and childs classes?

I am trying on a project to use private values in my internal functions. In past I used only public ones, but I noticed that obfuscation is working much better when using as much as possible private parameters. My question is regarding Parent/Child…
Siegfried.V
  • 1,508
  • 1
  • 16
  • 34
-1
votes
2 answers

Access and display order item meta data in Woocommerce

In Woocommerce I am trying to display the results of order item object and to access it: $product_meta = $item->get_meta_data(); print_r ($product_meta); This is what I am trying to pull: EDIT: This is the output that I get using…
-1
votes
1 answer

How to open a protected Excel File with ClosedXML?

Is it possible to use ClosedXML to open an Excel file protected with a password? And if so, how? I tried using Interop but it's very slow. Using Interop.Excel Microsoft.Office.Interop.Excel.Application wb = xlApp.Workbooks.Open(Filename:…
user2988717
  • 127
  • 3
  • 8
-1
votes
1 answer

Protect a Worksheet in Excel

I am attempting to create a excel document for technicians to enter data into. I want to make it so that when one technician enters in the information on line 7, that once he/she is finished, it automatically becomes protected so that the next…
-1
votes
1 answer

inheretance and using main method in its own class/package

So i have a paper publication class with protected variables and its own package. Then i have a book class that extends paper publication. This book class then has 3 classes that extend book class (all three same package) the book class has…
MasterYoshi
  • 57
  • 1
  • 7
-1
votes
1 answer

How to enter in Data Form in protected sheet

I tried searching for a solution for this but everything seems to point to VBA, which I'm totally clueless about. I tried their solutions but I'm not really getting it so I'm asking it here. I've created a sheet that allows other users in our…
Beginner1
  • 11
  • 1
  • 4
-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

How to I access a protected arraylist in a different class in the same method (javaFX)

Event class: protected List eventList = new ArrayList(); I have another class, a popup box which the user adds event information and an event object is created and added to the list. However i use the eventList, java doesn't recognise…
Billies Wesley
  • 437
  • 1
  • 6
  • 21
-1
votes
1 answer

Play a protected video content in iOS using AVPlayer

im trying to play a protected video which you need to be logged thru our API and get a cookie to access to the m3u8. In Safari, i need to be logged in in order to play the video. I tried to implement this but doesnt work at all. let…
jboisjoli
  • 99
  • 1
  • 10
-1
votes
1 answer

C++ protected typedef as return value

I'm not sure if this even is possible, but basically i have this pointer typedef that is protected in a class that i share among my threads and i want to make a function that returns a pointer of that typedef. I can declare the function in my .h…
Bolian
  • 41
  • 8
-1
votes
2 answers

C# access protected field of the object of derived class

There are two classes: class A { protected IntPtr i; public A(A copy) { this.i = SomeStaticClass.Copy(copy.i); } protected A(IntPtr ds) { this.i = ds; } } class B : A { public B(A init) { …
PsyWhat
  • 55
  • 5
-1
votes
1 answer

c++ initializer list issue - error: attempting to reference a deleted function

I'm using VS (2015) in c++ for the first time, and am a newbie at creating halfway decent code. Trying to do something simple - use an initializer list... but it's throwing this error: "C2280: attempting to reference a deleted function" I have…
tyhenry
  • 174
  • 1
  • 6
-1
votes
3 answers

Is any UIKit element declared in .h file public or protected in objective c?

i am a newbie in iOS development and i have a doubt that if i declare any UIKit element such as UILabel *label in some.h file not in .m file, is it protected or public to other classes if i import this class to another class and access it by using…
Ashley Rodrigues
  • 153
  • 2
  • 10
-1
votes
2 answers

How to create a pdf protected document without passwords?

I see some pdf files have no protections, but when you try to copy and paste text it appear as unredable "┤xDn║if|d├gDF"Ti&cD╬lh d FÁhis~n ╗xd f«"d┤ffih »h" And the images are also not copied (only print screen works). How can one create a pdf…
Anonymous
  • 167
  • 11
-1
votes
5 answers

Using $this when not in object context model class

I have stated my bespoke MV, I have a simple Model + controller classes and I can't get the var in the model to be recognsed when called by a different function The controller class is class StaffController { protected $module = "staff"; …
Richard Mc
  • 162
  • 1
  • 14