Linked Questions

0 votes
5 answers
2k views

This may seem pretty simple and I am sure it is, I am just not getting it. I understand that protected properties in a class in PHP can only be accessed within the class itself and inherited classes. ...
Sethen's user avatar
  • 11.4k
-2 votes
3 answers
275 views

There are 'public', 'private', and 'protected' in oop like c++ language. And I tried two kinds of simple programs. Below is first case in c++. class A { public: string name; } int main(void) ...
Jitoon's user avatar
  • 3
0 votes
0 answers
171 views

Dear all I have this code running on visual studio . I am getting error as below I have taken example from books. I have installed visual studio recently. I have tested basic code working well. I am ...
akash's user avatar
  • 1
0 votes
0 answers
30 views

On isocpp - faq for references it states: References are usually preferred over pointers whenever you don’t need “reseating”. This usually means that references are most useful in a class’s public ...
Simon's user avatar
  • 241
9 votes
1 answer
319 views

I can't find anything in the docs, but it seems that there is no access in a subclass to its superclass's private variables. Am I right? class A { has $!a; } class B is A { has $.b; method ...
Eugene Barsky's user avatar
-6 votes
4 answers
11k views

I am learning java programming from http://courses.caveofprogramming.com/courses/java-for-complete-beginners/lectures/38443 This guy, till now have been using the void keyword before declaring any ...
MartianCactus's user avatar
2 votes
6 answers
4k views

I have the following simple C# code, but I do not understand the output. using System; namespace ConsoleApplication4 { class myParent { public int id = 3; private string name ...
user avatar
1 vote
2 answers
719 views

I am trying to build an application in php and I have an encrypt/decrypt method that I am deploying, to enhance the security I declared these two methods as protected and I plan to have any class that ...
xenador's user avatar
  • 241
1 vote
2 answers
3k views

I stucked at this little piece of code: $fruit_object = new fruit(1234, 'apple', 'red apple'); try { $dbh = new PDO('mysql:host=localhost;charset=utf8;dbname=database', 'user', 'password'); ...
user avatar
0 votes
5 answers
2k views

I have a class, it has several public methods that use one private field that they all changed and use this field in their computations. I need subclass from this class with few new methods, new ...
Littlebitter's user avatar
3 votes
2 answers
2k views

Here is a class Encapsulate which has public property and a public method. class Encapsulate { public int a; public int b; public static void main(String...s) { Encapsulate e = new ...
Himanshu Bhandari's user avatar
2 votes
1 answer
1k views

The title says it all. I have a class with a lot of variables and a lot of methods in it. class bootstrap_class { public //-----Counters--------- $iColumn_count, $iLink_count, $iDia_count, $...
PIDZB's user avatar
  • 913
0 votes
3 answers
472 views

Hello I have trouble with working an inheritance constructor. I can't access the parent's fields. Here is my MyClass.h: #include "Parent.h" class MyClass : public Parent { public: MyClass(...
Alexandre Toqué's user avatar
0 votes
2 answers
327 views

I have the class structure below. I was wondering how I can access $varA from class C. And if I change a value within class A is it also visible in class C? Or when I call class C, are all the values ...
Patrick Rennings's user avatar
-6 votes
4 answers
212 views

I have two questions 1) Why can we give default value if the member is public but when it is private we are not allowed? Take below example: #include <iostream> using namespace std; class ...
curositykiller's user avatar

15 30 50 per page