Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 1343

Polymorphism is about using objects of a type uniformly, regardless of their subtype.

15 votes

How do you make a GUI for a polymorphic class?

You can use a visitor pattern: interface QuestionVisitor { void multipleChoice(MultipleChoice); void textBox(TextBox); ... } interface Question { void visit(QuestionVisitor); } clas …
Winston Ewert's user avatar
1 vote

How do you use duck typing in javascript without always checking for properties and methods?

I know I could just not check, but tracking down javascript run time errors can be a nightmare since they don't always happen where the error is actually occurring in the code. Indeed, the ty …
Winston Ewert's user avatar
13 votes

Is method overloading anything more than syntactic sugar?

The term syntactic sugar typically refers to cases where the feature is defined by a substitution. The language doesn't define what a feature does, instead it defines that it is exactly equivalent to …
Winston Ewert's user avatar