Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

learn more…| top users | synonyms (8)|oop jobs

0
votes
3answers
18 views

Search for object in array by parameter in Python

I used created an array of objects belonging to a class. Each object has values that are unique to themselves. I need to find class a parameter's value belongs to. For exampleclass Dog:def ...
0
votes
2answers
23 views

C++ Static Variable giving error [duplicate]

I am learning C++ and have a weird issue with a lab I am working on. Where I don't seem to be referencing things right would be my guess. It basically throws an error like it can't find the static ...
1
vote
0answers
11 views

Polymorphism: purpose of polymorphic reference

For example:class RuntimePolymorphismDemo {public static void main(String[] args) {Animal ref1=new Animal();Animal ref2=new Dog();Animal ref3=new Cow();Animal ref4=...
1
vote
1answer
24 views

How can an outer class access data from its inner class?

I am trying to better understand how to use sub-classes using a very simple test-case based off of this question/answer. class Outer():def __init__(self, x):self.x=super(Inner, self)...
1
vote
1answer
27 views

PHP OOP, how to properly use function arguments

I have a little problem, I will explain everything under the code:<?phpclass Fighter {public $name;public $health=100;public $power;public $mainhand;public function ...
-10
votes
0answers
45 views

C++ parameters with <> [on hold]

I cannot find out what's going on here.I have this prototype in .h file.bool set(std::vector < std::vector< double > > values);Can someone tell me what does it mean these parameters ?...
0
votes
4answers
49 views

Access variables from the instance from which the function was called

In one of the graduate courses I am taking, I have been given a library that declares an abstract function which I am expected to define. The function definition is as follows:public abstract class ...
0
votes
1answer
25 views

PHP - How does constructor parse data when inheriting?

I have 2 classes, one extends the other:class Human {const PERKS='none';public function __construct() {echo self::PERKS;}}class King extends Human {const PERKS='...
0
votes
0answers
22 views

Derived non auto-implemented properties [duplicate]

When creating a derived non auto-implemented properties should I reference the member variable or property in the derived property.In the example below are there any major difference / advantages ...
0
votes
1answer
19 views

Superglobals as parameters in php functions [duplicate]

I found myself in a need to set a default value for some method parameter from superglobal like:public function some_function ($foo=$_POST['foo'], $bar=$_POST['bar']){//some action}This ...
-1
votes
0answers
14 views

Php multiple headers in one page [duplicate]

I am trying to have multiple forms for 3 different users in one page, and they would show and hide based on a the drop down value that is prompted for the user before the signup forms are visible....
-3
votes
0answers
29 views

NameError: name 'steven' is not defined [on hold]

I am having trouble with validating the fname property on my code. When the user wants to change the first name of the Customer instance "Steven" they type into the python shell Steven....
0
votes
1answer
28 views

Call an objects setter when its children are assigned to

Let there be an object userSingleton defined as such:var userSingleton=new function() {var _user=undefined;Object.defineProperty(this, 'activeUser', {get: function() {...
0
votes
1answer
23 views

PHP class extending of extended class

I try to extend Widget_Social_Links class: class Widget_Social_Links extends WP_Widget {}class VD_Widget_Social_Links extends Widget_Social_Links {}and init with widgets_init hookfunction ...
2
votes
3answers
110 views

Private getters and setters [on hold]

I am still new to C++ and OOP programming, and I was just wondering about something curious.I have a class let's name it Foo, with some private members.My question is: the Foo objects don't "pass ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,