Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
Given:
Armor.java
public class Armor extends Item {/* Implementation not shown */}
Key.java
public class Key extends Item {/* Implementation not shown */}
Potion.java
public class Potion extends Item {/* Implementation not shown */}
Item.java
public class Item { public Item() {} }
Main.java
public class Main { public static void main(String[] args) { Armor armor = new Item(); Key key = new Item(); Potion potion = new Item(); } }
What will this program do?
Run to completion
Compile error
Runtime Error
Infinite Loop