This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WithAbstractions { | |
int upClass = 500000; | |
int midClass = 100000; | |
int lowClass = 50000; | |
int taxMax = 0.45; | |
int taxMid = 0.30; | |
int taxMin = 0.15; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WithoutAbstractions { | |
int upClass = 500000; | |
int midClass = 100000; | |
int lowClass = 50000; | |
int taxMax = 0.45; | |
int taxMid = 0.30; | |
int taxMin = 0.15; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DuplicationRemoved { | |
String buildingType; | |
int HOUSE_NUM = 5; | |
int SHORT_NUM = 10; | |
int TALL_NUM = 20; | |
int V_TALL_NUM = 40; | |
public static void classifyBuilding(int floors) { | |
if (floors < HOUSE_NUM) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DuplicationExample { | |
String buildingType; | |
public static void classifyBuilding(int floors) { | |
if (floors < 5) { | |
buildingType = "house"; | |
} else if (floors < 10) { | |
buildingType = "short"; | |
} else if (floors < 20) { |