File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
lesson_16/objects/objects_app/src/main/java/com/codedifferently/lesson16/KimberleeObject Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ public class HeadPhones {
1212 private boolean isWireless = true ;
1313 private String brands = "Beats" ;
1414 private boolean isConnectedToBluetooth = false ;
15-
1615 public enum HeadPhoneColor {
1716 RED ,
1817 BLUE ,
@@ -91,14 +90,15 @@ public static boolean isPreferredBrand(String brand) {
9190 }
9291 }
9392
94- public void connectToBluetooth () {
93+ public boolean connectToBluetooth () {
9594 if (isPoweredOn && isWireless ) {
9695 isConnectedToBluetooth = true ;
9796 }
97+ return isConnectedToBluetooth ;
9898 }
9999
100100 public boolean isConnectedToBluetooth () {
101- return isConnectedToBluetooth ;
101+ return connectToBluetooth () ;
102102 }
103103
104104 public void wirelessConnection () throws ConnectionNotFoundException {
You can’t perform that action at this time.
0 commit comments