Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Posts tagged oop

3 child tags

For questions about using object-oriented programming (OOP).

This tag doesn't have a detailed wiki yet.

81%
+7 −0
Q&A How to define an object with different subclasses in an if-statement?

Note: I asked this question on TopAnswers a couple weeks ago, but didn't get any response, so I figured I'd ask it here. I am currently learning C++. I have a parent class (Vehicle) and two subc...

1 answer  ·  posted 2mo ago by Trevor‭  ·  edited 2mo ago by Alexei‭

83%
+8 −0
Q&A Is partial allocation of an object Undefined Behavior?

Is it valid to partly allocate an object, as long as you only use the allocated part of it? #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; struct s { int i[100]; }; int main(void) {...

1 answer  ·  posted 2mo ago by alx‭  ·  last activity 2mo ago by Lundin‭

83%
+8 −0
Q&A When would one not want to return an interface?

Consider the following method as an example: List&lt;int&gt; Foo() { // ... } Are there any disadvantages of returning an interface instead of a concrete implementation in C#? IList&lt;i...

2 answers  ·  posted 3mo ago by Moshi‭  ·  last activity 2mo ago by r~~‭

85%
+10 −0
Q&A How to do private encapsulation in C?

I'm using an object-oriented design for my C project and trying to implement classes with private encapsulation. How do I do this? Some things I've tried that are problematic: Using a struct f...

1 answer  ·  posted 1y ago by Lundin‭  ·  last activity 7mo ago by Lundin‭

81%
+7 −0
Q&A What allows a string slice (&str) to outlive its scope?

As a relative newcomer to Rust, I'm trying to understand the behaviour of lifetimes, but I am confused by the following code: let s: &amp;str = "first"; let mut r: &amp;str = s; println!("First ...

2 answers  ·  posted 9mo ago by InfiniteDissent‭  ·  last activity 9mo ago by Moshi‭

63%
+5 −2
Q&A Why object-oriented instead of class-oriented?

I understand that in object-oriented programming, an object is an instance of a class. If it's an instance, I misunderstand why does it need the term object at all (we could just say "instance"). ...

4 answers  ·  posted 1y ago by deleted user  ·  last activity 1y ago by hkotsubo‭

Question terminology oop
53%
+5 −4
Q&A What's the difference between Inheritance and Polymorphism?

I'm using Java code as an example, but this can be answered if you don't know Java. class Bird{ public void sing(){ System.out.println("Testing"); } } class anClass ex...

2 answers  ·  posted 1y ago by deleted user  ·  edited 1y ago by Alexei‭

62%
+3 −1
Q&A Are there practical reasons for designing a method-only class/object?

Are there practical reasons for designing/implementing a method(s)-only class/object? Follow-up background notes: This question is for languages that are not exclusively Object-Oriented, for exam...

3 answers  ·  posted 1y ago by CodeFarmer‭  ·  last activity 1y ago by hkotsubo‭

25%
+0 −4
Q&A Did functional programming predated Object oriented programming or rather the opposite?

By "functional" I don't mean "procedural" (i.e. I don't mean to programming which is done solely or primarily with these data structures commonly known as "functions" but are actually procedures), ...

2 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by nelson777‭