Suppose that a class named Bicycle contains a private nonstatic integer named height, a public nonstatic String

Question:

Suppose that a class named Bicycle contains a private nonstatic integer named height, a public nonstatic String named model, and a public static integer named wheels. Which of the following are legal statements in a class named BicycleDemo that has instantiated an object as Bicycle myBike = new Bicycle();?
a. myBike.height = 26;
b. myBike.model = "Cyclone";
c. myBike.wheels = 3;
d. myBike.model = 108;
e. Bicycle.height = 24;
f. Bicycle.model = "Hurricane";
g. Bicycle.int = 3;
h. Bicycle.model = 108;
i. Bicycle.wheels = 2;
j. Bicycle yourBike = myBike;

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 978-1337397070

9th edition

Authors: Joyce Farrell

Question Posted: