Computer Science, asked by aastha263, 1 year ago

What are the advantages and disadvantages of switch statement over if - else if in java?

Answers

Answered by Attagirl
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.
Similar questions