Question: GetInfo.java: public class GetInfo { public static void main(String[] args) { Stone stone = new Stone(); /*

Context: There are six infinity stones in Marvel's Cinematic Universe, each gives


GetInfo.java: 

public class GetInfo {
  public static void main(String[] args) {
     Stone stone = new Stone();
     
     /* Your solution goes here  */

  }
}

----------------------------------------------------------------------

InfinityStone.java:

public class InfinityStone {
  private String stoneName;
  private String stoneVessel;

  public void setStoneName(String name) {
     stoneName = name;
  }
 
  public String getStoneName() {
     return stoneName;
  }

  public void setStoneVessel(String vessel) {
     stoneVessel = vessel;
  }
 
  public String getStoneVessel() {
     return stoneVessel;
  }

  public void printStoneInfo() {
     System.out.print("Name: " + stoneName);
     System.out.print(", Vessel: "  + stoneVessel);
  }
 
}

----------------------------------------------------------------------

Stone.java: 

public class Stone extends InfinityStone {
  private String stoneLocation;
  private boolean acquired;

  public void setStoneLocation(String location) {
     stoneLocation = location;
  }

  public String getStoneLocation(){
     return stoneLocation;
  }
 
  public void setAcquired(boolean a) {
     acquired = a;
  }

  public boolean getAcquired(){
     return acquired;
  }

}

Context: There are six infinity stones in Marvel's Cinematic Universe, each gives special abilities to the beholder. Thanos has vowed to find them all. Thanos is one of the strongest creatures in the universe. However, he lacks a system to track infinity stones and their whereabouts. He recently came across Earth's cutting edge programming language Java and shall use this technology to track stones and their information. Assign the stone's name with "Mind", the vessel with "Loki's Scepter", location with "Asgard" and acquired with false. Use printStoneInfo() member method and a separate println() statement to output stone's data. Sample output from the given program: Name: Mind, Vessel: Loki's Scepter, Location: Asgard, Acquired: false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete the provided code and output the stones data you can modify the GetInfo class as follows ... 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

Document Format (2 attachments)

PDF file Icon

661e853fbd08d_880483.pdf

180 KBs PDF File

Word file Icon

661e853fbd08d_880483.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!