Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help asap public class GaneItem( protected String nane; se public String getName() { 6 return names 7 > se public void settime(String nane) (

image text in transcribed
need help asap
image text in transcribed
public class GaneItem( protected String nane; se public String getName() { 6 return names 7 > se public void settime(String nane) ( this.name - same; 10 ) 110 protected GameItem(string nane) 12 this.namenane; 13 ) public void use() { 15 16 > 17 public void displayAttributes(X 18 System.out.println("ite name: nane): 19 ) 20 22 The code below is a subclass of the code above. This program also inherits the open and close methods from an interface named Openable. Fill in the blanks. Some words can be used more than once. import java.util.ArrayList; public class Container 1 Gameiten 2 Openable ArrayListcoanetes content ne ArrayListItem>(); boolean IsOpen-false; Container(string none) 1/1000 Auto-generated constructor stub public void displayAttributes displayAttributes fortes :) System.out.println(); 1 1 public void set) System.out.println("You use the this.name); pulit veld open) Systes.out.print into open the this.name) 1 veld Close() System.out.println("Yo close the Lease import java.util.ArrayList; public class Container GameItem Openable{ 3 ArrayList content= new ArrayList(); 4. boolean isOpen=false; e 5 Container(String name) { 6 (name); // TODO Auto-generated constructor stub } public void displayAttributes(){ 2 7.displayAttributes(); 3 for(GameItem C : 8 ) { System.out.println(c); 5 } 6 } 70 public void use() { 8 System.out.println("You use the "+this.name); 9 } public void open() { 1 System.out.println("You open the"+this.name); 22 9. isOpen=true; 23 } 24 public void close() { 25 System.out.println("You close the "+this.name); 10. isOpen=false; } 28 29] 26 27

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions