Ask Question
8 September, 23:30

3. 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 C); ? f. Bicycle. model Hurricane a. myBike height 26; b. my Bike model Cyclone g. Bicycle. int 3 3; c. myBike Wheels 3 d. my Bike. model 108; i. Bicycle wheels 2 e. Bicycle height 24; j. Bicycle yourBike myBike

+4
Answers (1)
  1. 8 September, 23:52
    0
    The solution to the given problem is provided below.

    Explanation:

    a.) myBike. height = 26; Not Legal statement

    b.) myBike. model = "Cyclone": Legal statement

    c.) myBike. wheels = 3; Legal statement

    d.) myBike. model = 108; Not legal statement

    e.) Bicycle. height = 24; Not Legal statement

    f.) Bicycle. model = "Hurricane"; Not legal statement

    g.) Bicycle. int = 3; Not Legal statement

    h.) Bicycle. model = 108; Not Legal Statement

    i.) Bicycle. wheels = 2; Legal Statement

    j.) Bicycle yourBike = myBike; Legal Statement
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “3. Suppose that a class named Bicycle contains a private nonstatic integer named height, a public nonstatic String named model, and a ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers