What are the advantages and disadvantages of switch statement over if - else if in java?
Answers
Answered by
7
Disadvantage-
i)switch case can only compare equalities.
ii)switch case can only check integer function
Advantage-
i)A switch statement works much faster than equivalent if-else ladder.
i)switch case can only compare equalities.
ii)switch case can only check integer function
Advantage-
i)A switch statement works much faster than equivalent if-else ladder.
Similar questions
Math,
7 months ago
Social Sciences,
7 months ago
English,
7 months ago
Social Sciences,
1 year ago
English,
1 year ago
English,
1 year ago
Environmental Sciences,
1 year ago
History,
1 year ago