Question: Given the following two classes, each in a different package, which line inserted into the code allows the second class to compile? A. static import
Given the following two classes, each in a different package, which line inserted into the code allows the second class to compile?

A. static import clothes.Store.getClothes;
B. import clothes.Store.*;
C. import static clothes.Store.getClothes;
D. import static clothes.Store;
package clothes; public class Store { public static String getClothes() { return "dress"; } } package wardrobe; // INSERT CODE HERE public class Closet { } public void borrow () { System.out.print("Borrowing clothes: "+getClothes()); }
Step by Step Solution
3.47 Rating (157 Votes )
There are 3 Steps involved in it
To allow the second class Closet to compile and correctly use the getClothes method from the Store c... View full answer
Get step-by-step solutions from verified subject matter experts
