I'm trying implement below simple logic with a best way (performance wise), will I get a advantage using switch over if else statements in this scenario. (I went through some similar questions here and found that polymorphism can be use in situations like this but I cannot find a way to apply it since I'm new to OOP )
Thank you!
status = statusCheck();
if(status == done){
// done
} else if (status == fail){
// fail
} else if (status == processing){
thread.sleep();
status = statusCheck();
if(status == done){
// done
} else if (status == fail){
// fail
} else {
//do somthing
}
}