Question: Consider: class Bike private String color; public Bike) { } public Bike(String newColor) { color = newColor; } public Bike (Bike bike) { color -


Consider: class Bike private String color; public Bike) { } public Bike(String newColor) { color = newColor; } public Bike (Bike bike) { color - bike.color; } public String getColor() { return color; } public void setColor(String newColor) { color = newColor; } } Bike bikel = new Bike(); Bike bike2 = new Bike("blue"); Bike bike3 = new Bike (bike2); bike2.setColor("green"); Bike bike4 = new Bike (bike2); Which of the following are correct? bike2.getColor() returns "green" bike2.getColor() returns "blue" bike4.getColor() returns null bike1.getColor() returns bike3.getColor() returns "blue" bike1.getColor() returns null bike3.getColor() return null bike4.getColor() return "blue" bike4.getColor() return "green" bike3.getColor() return "green
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
