1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What are wrapper classes
They provide a way to use primitive data types as objects.
Arraylist <int> → Why is this invalid
Collection classes only store objects. Primitive data types no work.
Collection
Container to hold multiple objects
Framework
Basic structure/toolkit to use something more efficiently.
Java framework
Ready made set of classes and interfaces with built in method you can use.
Collections framework
A set of classes and interfaces
Sorting, Searching, Inserting/Deleting, Data manipulation
Interface
Like a class but cannot be used to create an object.
Method signatures but no body.
Class can implement an interface
What can a class do with an interface that it cannot do with other classes
A class can implement multiple interfaces (like a contract), but cannot extend multiple classes.
It is REQUIRED to override every method in the interface.
List vs Set collections
List allows duplicates, set does not.
Use ArrayList when
Fast access to elements via index
You don’t need to frequently add/remove elements in the middle
Use LinkedList when
Efficient insertion/deletion in the middle
Random access is not a priority
What is abstraction
Hiding complex details and only showing what is necessary.
Abstract classes cannot be instantiated
Abstract methods must be implemented
Enforces and organizes
Interface vs abstract
Everything in interface is assumed to be abstract.
You can only extend one class, implement as many as you want. Every field in interface is static and final.