+ 1
What is the best scenario where one uses switch statements in creating a website???
2 Antworten
+ 11
switch (user.getRole()) {
case 1: // Admin
loadAllPosts();
break;
case 2: // Moderator
loadHeldForModerationPosts();
break;
default: // Regular user
loadVisiblePosts();
}
+ 1
Igor Makarsky Thankyou