Top "Oop" questions

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

Creating the Singleton design pattern in PHP5

How would one create a Singleton class using PHP5 classes?

php oop design-patterns singleton
Why not inherit from List<T>?

When planning out my programs, I often start with a chain of thought like so: A football team is just …

c# .net list oop inheritance
Amazon Interview Question: Design an OO parking lot

Design an OO parking lot. What classes and functions will it have. It should say, full, empty and also be …

oop
OOP vs Functional Programming vs Procedural

What are the differences between these programming paradigms, and are they better suited to particular problems or do any use-cases …

oop functional-programming paradigms procedural-programming
JavaScript: Class.method vs. Class.prototype.method

What is the difference between the following two declarations? Class.method = function () { /* code */ } Class.prototype.method = function () { /* code using this.…

javascript oop prototype-programming
Why Doesn't C# Allow Static Methods to Implement an Interface?

Why was C# designed this way? As I understand it, an interface only describes behaviour, and serves the purpose of …

c# oop language-features
How should a model be structured in MVC?

I am just getting a grasp on the MVC framework and I often wonder how much code should go in …

php oop model-view-controller architecture model
How to call a parent method from child class in javascript?

I've spent the last couple of hours trying to find a solution to my problem but it seems to be …

javascript oop methods parent
What does it mean to "program to an interface"?

I have seen this mentioned a few times and I am not clear on what it means. When and why …

language-agnostic oop interface
Why does Python code use len() function instead of a length method?

I know that python has a len() function that is used to determine the size of a string, but I …

python function oop methods string-length