1/20
Vocabulary flashcards for Map and Set methods, Comparable, Locatable, and Movable interfaces, and abstract class keywords.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
map.put(x, y)
Adds the
map.get(x)
Gets the value for key x.
map.containsKey(x)
Checks if key x is in the map.
map.keySet()
Returns a set of all keys in the map.
map.values()
Returns a collection of all values in the map.
map.size()
Returns the number of items in the map.
map.clear()
Removes all items from the map.
(Set)set.add(x)
Adds item x to the set.
(Set)set.remove(x)
Removes an item from the set.
(Set)set.size()
Returns the number of items in the set.
(Set)set.clear()
Removes all items from the set.
compareTo(Object o)
Interface method in Comparable used to compare the current object with another object.
Arrays.sort(list)
Sorts an array using the compareTo() method of each object.
getX()
Returns the x-coordinate (from Locatable interface).
getY()
Returns the y-coordinate (from Locatable interface).
setPos(x, y)
Sets x and y positions (from Movable interface).
setX(x)
Sets x position (from Movable interface).
setY(y)
Sets y position (from Movable interface).
abstract
Keyword used to declare an abstract class or an abstract method without a body.
toString()
Concrete method in superclass that prints object info or combined method outputs.
super(nm)
Calls the constructor of the super abstract class.