Problem I have a simple two-class hierarchy to represent U.S. ZIP (12345) and ZIP+4 (12345-1234) codes. To allow clients to […]
Tag: polymorphism
Is this the proper way to find the subclass of a polymorphic superclass?
Problem I came across polymorphism in the book that I’m reading and decided to do a little experiment. Essentially what […]
C function to print arrays of arbitrary data type
Problem C is naturally clumsy at polymorphism but I wanted to avoid duplication so I wrote this function. But I’m […]
Curiously Recurring Template Pattern (CRTP) implementation
Problem I’m implementing Curiously Recurring Template Pattern(CRTP) in Java as follows. The Interface: /** * Reason for the generic Value<T […]
Drawing various types of shapes [closed]
Problem Closed. This question is off-topic. It is not currently accepting answers. Lacks concrete context: Code Review requires concrete code […]
designing application using polymorphism
Problem I have created a polymorphic system, but I don’t know whether this is the correct way of doing it. […]
Increment object properties based on a particular subclass of an abstract class
Problem I have a Composition object that contains 4 ArrayList objects, each of which contains objects of a particular subclass […]
Builder pattern in C# supporting subclassing with nested classes [closed]
Problem Closed. This question is off-topic. It is not currently accepting answers. Lacks concrete context: Code Review requires concrete code […]
Type dispatch based on runtime value
Problem Suppose we’re implementing an interpreter for the bytecode of some stack machine. Let every element of the stack be […]
Check if JavaScript input is empty
Problem Having a general utility function to see if the input is empty makes sense to me. Empty means different […]
- 1
- 2