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? 

package clothes; public class Store { public static String getClothes() { return

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

1 Expert Approved Answer
Step: 1 Unlock

To allow the second class Closet to compile and correctly use the getClothes method from the Store c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!