What will be the output of the following program.
Correct Answer : D
main method, an object for class
Bike is created. It is created using parameterised constructor of
new Bike("Hero Honda", "Shine", 125) is encountered, control goes to constuctor and
company is initialized to
125. Control goes back to
main method to the line
bike.mileage = 72.5. This initializes
72.5. The next statement makes
diskBrakes of object
false. Now these values of object
bike (which is an instance of
Bike) are printed using display statement.