Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:java-best-practices/switch-few-branches
Language: Java
Severity: Warning
Category: Best Practices
Description
switch statements are used to trigger different block of code based on different values. Developers should avoid switch statements with less than 3 branches. If a switch statement has less than 3 branches, we should rather use a if statement.