Submission: switch (...) instanceof feature (original) (raw)
Artur Biesiadowski abies at adres.pl
Sun Mar 29 12:38:52 PDT 2009
- Previous message: Submission: switch (...) instanceof feature
- Next message: Submission: switch (...) instanceof feature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Why case void: instead of case null: ?
What is a expected behavior in case of multiple matches ? For example
switch(collection) instanceof {
case RandomAccess: ...
case List: ...
case Collection: ...
}
Do I need to put switch cases in correct order because of top-to-down evaluation or most specific one will be used? Or maybe all matching ones ?
- I think you have forgotten to put 'break' in your examples, unless you plan to disallow fall-through.
Regards, Artur Biesiadowski
- Previous message: Submission: switch (...) instanceof feature
- Next message: Submission: switch (...) instanceof feature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]