Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [object-oriented]

Questions about the principles of the object-oriented programming paradigm.

Filter by
Sorted by
Tagged with
-3 votes
0 answers
20 views

Why is it necessary to include brackets next to the class name in Python, while calling a method? [closed]

...
Kal's user avatar
  • 1
0 votes
0 answers
16 views

Compile vs Runtime Binding

I have java code. In first example, it is said that compile time binding is here, But in second example, ...
amangupta's user avatar
0 votes
0 answers
17 views

Term for two objects with the same properties or keys

I believe I learned (and later forgot) a term for two (or more) objects/dictionaries, with the same property schema. Googling has not helped. For example, these objects are TERMs because they have all ...
Christopher Meyers's user avatar
4 votes
0 answers
41 views

Prior or subsequent art for Microsoft COM’s “causality IDs”

Microsoft COM, in its object RPC part, had a peculiar mechanism that could be used to prohibit concurrent calls to the same object (or another object serviced by the same event loop) but permit ...
Alex Shpilkin's user avatar
0 votes
1 answer
3k views

warning: ISO C++ forbids converting a string constant to ‘char*’ [closed]

I am new to C++, and upon running this code I am getting the following error, can someone please explain what's wrong with the code? Thank you. main.cpp:8:17: warning: ISO C++ forbids converting a ...
SRI's user avatar
  • 3
0 votes
0 answers
36 views

Clarification about a sentence from GoF Design Patterns book

I'm currently reading Design Patterns: Elements of Reusable Object-Oriented Software by GoF and having trouble understanding the following sentence (page 19, Section 1.6): Composition requires ...
Albert Huzejrovic's user avatar
0 votes
4 answers
259 views

Are integers an abstract data type?

I'm trying to understand whether integers are an abstract data type. The Wikipedia article starts out by saying that integers are not an ADT: In practice, many common data types are not ADTs, as the ...
user51462's user avatar
  • 123
0 votes
1 answer
75 views

Why we dont use dot operator with int or any other datatype

Okay so imma noob as my question itself will suggest . And I know that of If I want to access a public class member we have to use the dot operator with the object . So we know that int , float etc ...
Shraddha Agrawal's user avatar
4 votes
1 answer
67 views

Covariance and Contravariance: Conflict without a Cause

Here is the last paragraph at page 441 of the paper ‘Covariance and Contravariance: Conflict without a Cause’ by Giuseppe Castagna: How is all this translated into object-oriented type systems? ...
Géry Ogam's user avatar
0 votes
1 answer
69 views

Which type can cause problems with encapsulation in Java?

Out of the following, which type can cause problems with encapsulation? A. Int B. Int[] C. String D. non of the above I chose D and was incorrect. I am kind of confused what this questions is asking ...
SixTwelfthsPi's user avatar
0 votes
1 answer
97 views

Definition of static property of object in OOP

Grady Booch in Object-Oriented Analysis and Design with Applications says: The state of an object encompasses all of the (usually static) properties of the object plus the current (usually dynamic) ...
hasanghaforian's user avatar
-1 votes
1 answer
47 views

Can a data abstraction use a class as a field, parameter, or return type?

I think that everyone will agree that the following class achieves data abstraction (hiding of its internal representation): ...
Géry Ogam's user avatar
0 votes
2 answers
194 views

Is programming an emulation of the real world?

Assume that we have a car in the real world, this car would be composed of atoms, and we can do operations on this car (for example: we can move the car or change its color, etc.). And assume that we ...
user134911's user avatar
0 votes
0 answers
20 views

How come code re-usability is a benefit of Bottom-Up software development?

Re-usability of code is one of the main benefits of the bottom-up approach (Wikipedia) I can't quite figure out how bottom-up approach enables code re-usability. I am aware that Object Oriented ...
Midhunraj R Pillai's user avatar
1 vote
1 answer
451 views

Is object oriented programming considered to be a declarative programming approach?

Is object oriented programming considered to be a declarative programming approach? On Wikipedia, it is said that OOP tries to extend the imperative programming paradigm to a somewhat declarative ...
Pat8's user avatar
  • 175
2 votes
1 answer
45 views

Subclass specification

From http://web.mit.edu/6.031/www/fa19/classes/12-interfaces-enums/#implementing_generic_interfaces "That means B is only a subtype of A if B’s specification is at least as strong as A’s ...
Ray's user avatar
  • 137
1 vote
0 answers
25 views

Unifying object oriented language

I'm not sure if this is off-topic but I was thinking about the following: many modern (object-oriented) programming languages are very similar at their core, i.e. they share language features like ...
Peter's user avatar
  • 111
-1 votes
1 answer
280 views

Blueprint for class and objects in Java

Good morning everybody. I would like to know if there is a blueprint I could refer to when creating classes and objects in Java? For instance, I was told for classes. You start VARIABLES DECLARATIONS ...
user127836's user avatar
-1 votes
1 answer
37 views

Java programming object terminology

Say there is a class called Person. Then in the following expression : Person human = new Person() Which is the "reference&...
zach's user avatar
  • 11
0 votes
2 answers
79 views

Are objects appropriate for modeling the real world?

First of all, I know objects are not meant to model the real world, although they have been marketed as such and perhaps that was an intention at some point. Here I say 'modeling the real world' in a ...
Piovezan's user avatar
  • 113
0 votes
0 answers
24 views

Object algebras without anonymous inner classes

In de Oliveira and Cook's Extensibility for the Masses uses Java for its code (it's not about stuff specific to that language though) and the ability to create anonymous inner classes is used ...
ByteEater's user avatar
  • 115
0 votes
2 answers
141 views

What subfields in computer sciences may one study without learning Object Oriented Programming?

What subfields in computer sciences may one study without learning Object Oriented Programming or is there some kind of degree in Computer Science without the OOP knowledge requirement? Is there a ...
Muon3pi's user avatar
1 vote
1 answer
17 views

Method provided by component may need to be implemented, What does this mean?

I can't wrap my head around this statement: One common drawback of using composition instead of inheritance is that methods being provided by individual components may have to be implemented in the ...
asds_asds's user avatar
  • 279
3 votes
0 answers
165 views

Is this possible: In OOP, private methods in a class form a F-coalgebra and public methods in a class form an F-algebra?

I recently found out that OOP classes turn out to be F-coalgebras: https://www.semanticscholar.org/paper/Objects-and-Classes%2C-Co-Algebraically-Jacobs/c7c45abf7d99e0aef627fd5223023bf82e70dc71 The ...
fsuna064's user avatar
  • 131
54 votes
1 answer
12k views

What is the earliest use of the "this" keyword in any programming language?

I understand the this (or self or Me) is used to refer to the current object, and that it is ...
huijing's user avatar
  • 651
0 votes
0 answers
33 views

data structures/ Classes for RNA & DNA

In bioinformatics they study biological data. I have seen codes dealing with DNA sequences. However, they are treated as string literal. I was wondering if there were data structures or classes in OOP ...
chikitin's user avatar
  • 101
1 vote
1 answer
416 views

Usage of stacks and heaps in object-oriented programming. Reasons?

In object oriented programming heaps are used for to store the actual objects. Stacks are used for storing reference-variables to the objects. What's the concrete reasons for choosing those two ...
mizech's user avatar
  • 113
1 vote
1 answer
89 views

What does valid method overriding mean?

In Types and Programming Languages by Pierce, from p257 to p258, about featherweight Java, The predicate override(m, D, C→C0) judges whether a method ...
Tim's user avatar
  • 4,925
1 vote
2 answers
109 views

Which is a type of objects in mainstream OO languages: a class, an interface, an abstract class, a metaclass?

In Types and Programming Languages by Pierce, Section 18.6 Simple Classes in Chapter 18 Imperative Objects says: We should emphasize that these classes are values, not types. Also we can, if we ...
Tim's user avatar
  • 4,925
2 votes
1 answer
122 views

In what sense if any does java have multiple dispatch?

I'm trying to get my head around the difference between message passing (with which we are all familiar as by far the most common form of object orientation today) vs generic functions as implemented ...
mwal's user avatar
  • 121
4 votes
0 answers
82 views

Scopes vs objects -- would a language make sense that voids the difference?

So there's this adage that says "Objects are a poor man's closures", which can equally well be reversed, which I understand to mean that they are equivalently expressive. What strikes me about the ...
Kelley van Evert's user avatar
0 votes
1 answer
94 views

Does the concept of subtype require dynamic method binding?

https://en.wikipedia.org/wiki/Subtyping says In programming language theory, subtyping (also subtype polymorphism or inclusion polymorphism) is a form of type polymorphism in which a subtype is a ...
Tim's user avatar
  • 4,925
0 votes
1 answer
272 views

Why there aren't any famous programming languages that implement what Alan Kay considers to be "real OOP"? [closed]

Why there aren't any famous programming languages that implement what Alan Kay considers to be "real OOP"? Is it because the "modern OOP" that exists in programming languages like C++ and C# and Java ...
user106024's user avatar
2 votes
0 answers
781 views

Four Pillars of Object Oriented Programming

I'm researching object oriented programming and I've come across the term "four pillars of OOP" in a few places now. I originally saw them listed as: Abstraction Encapsulation Inheritance ...
Philip Kirkbride's user avatar
2 votes
0 answers
38 views

Describing C3 in terms of predicates on types

What is the right way to describe the properties for a method resolution order that naturally lead you to the C3 linearization algorithm? I'm trying to nail down desiderata for an MRO that are ...
Greg Nisbet's user avatar
2 votes
1 answer
182 views

Curry-howard isomorphism in object oriented programming languages

I want to get a better intuition for the curry howard isomorphism, and my intuition is mainly based on object oriented programming languages like JavaScript. So as an example, I am going to formalize ...
user600670's user avatar
-2 votes
2 answers
43 views

How to specify a robot go always right relative to itself from absolute perspective (north west east south)

I have a robot that has a start and goal position within a maze. Each point in the maze-grid is simply a Position object containing x and y. I need an algorithm that specifies the robot only moving to ...
Senethys's user avatar
2 votes
1 answer
145 views

How to implement polymorphism in a turing complete environment?

I'm currently programming in an unnamed turing complete language which has support for pointers, primitive data types, structures, closures, and garbage collection, among other things. I'm trying to ...
Hatefiend's user avatar
  • 131
1 vote
1 answer
503 views

Auto-generating a class hierarchy/inheritance tree from a data set of objects with properties

What is an algorithm that will take as an input a flat list of objects with a varying degree of overlapping properties: ...
davidlav's user avatar
  • 143
10 votes
1 answer
2k views

What is the origin of dot notation?

In object-oriented programming, dot notation is used when accessing the properties or methods of a class: ...
JeffThompson's user avatar
4 votes
0 answers
30 views

N-Dimensional method lookup: sender vs context

So, there is an idea about multi-dimensional behaviour selectors that goes like follows (based on paper by R.Hirschfeld and P.Costanza : "Context oriented programming"): "selector": in 1D lookup we ...
artemonster's user avatar
0 votes
2 answers
4k views

Is the implementation relation between an interface and a class an instantiation or inheritance relation, or neither?

In Python, we have metaclass and abstract class. In Java and C#, we have interface and <...
Tim's user avatar
  • 4,925
6 votes
1 answer
1k views

Is it possible to implement dependent types by any object oriented language supporting inheritance and classes?

When I was reading Agda tutorial, I noticed resemblance between dependent type declarations and class definitions which I've been primarily used to work with. I'm not totally sure how much sense this ...
MarkokraM's user avatar
  • 395
2 votes
1 answer
220 views

What's the difference between subtyping and inheritance?

In object-oriented programming, I have learned the concept of subtyping and inheritance. I thought they're the same thing, in ...
ice1000's user avatar
  • 940
2 votes
1 answer
71 views

Are synchronous message sends a subset of async. ones?

Imagine any object oriented PL based around the idea of message sends: some method basically performs something like this: ...
artemonster's user avatar
1 vote
1 answer
47 views

Was multiple inheritance ever implemented by adding redundant data members?

In discussions about why most languages which implement inheritance only implement single-inheritance, the question of the precise semantics of overlaps often comes up, and having redundant data ...
Ryan1729's user avatar
  • 364
1 vote
0 answers
65 views

Explain static and dynamic binding without Overloading and Overriding?

few days ago I attended a interview, and the interviewer asked me a very common but strange question. Explain static and dynamic binding without using method overloading and method overriding ? I ...
Vivek Singh's user avatar
7 votes
1 answer
2k views

The C3 linearization algorithm for method resolution in multiple inheritance OO languages: Looking for a justification for some implementation detail

According to this description of Python's method resolution order (mro), a.k.a. C3 linearization, the algorithm can be described recursively as follows: ...
Evan Aad's user avatar
  • 237
2 votes
2 answers
464 views

Are grandparent classes also parents?

Let's say I have three classes, Animal, Bird and Pigeon. If ...
Esda's user avatar
  • 21
6 votes
2 answers
772 views

What would "sum types with functions" look like in OOP?

It's fair to summarize classes in OOP as "product types with functions." However, couldn't there be something like "sum types with functions"? How would inheritance work with them? I'm trying to ...
Fomalhaut's user avatar