Question: GetInfo.java: public class GetInfo { public static void main(String[] args) { Stone stone = new Stone(); /*
GetInfo.java: public class GetInfo { } ---------------------------------------------------------------------- InfinityStone.java: public class InfinityStone { public void setStoneName(String name) { public void setStoneVessel(String vessel) { public void printStoneInfo() { ---------------------------------------------------------------------- Stone.java: public class Stone extends InfinityStone { public void setStoneLocation(String location) { public String getStoneLocation(){ public boolean getAcquired(){ }
public static void main(String[] args) {
Stone stone = new Stone();
/* Your solution goes here */
}
private String stoneName;
private String stoneVessel;
stoneName = name;
}
public String getStoneName() {
return stoneName;
}
stoneVessel = vessel;
}
public String getStoneVessel() {
return stoneVessel;
}
System.out.print("Name: " + stoneName);
System.out.print(", Vessel: " + stoneVessel);
}
}
private String stoneLocation;
private boolean acquired;
stoneLocation = location;
}
return stoneLocation;
}
public void setAcquired(boolean a) {
acquired = a;
}
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
To complete the provided code and output the stones data you can modify the GetInfo class as follows ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
661e853fbd08d_880483.pdf
180 KBs PDF File
661e853fbd08d_880483.docx
120 KBs Word File
