1/13
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Generics
let you specify what type of object a class can hold.
UML = unified modeling language
Blueprint for classes
Encapsulation
is wrapping data and methods together while hiding internal details.
What are javadoc comments
Special comments used to automatically generate documentation.
Overloading
Same method name
DIFFERENT parameters
Overriding
Same method signature
Different implementation INHERITANCE
TRY exception
Code that might fail, it runs
catch exception
handles the error (catches the error and runs appropriately)
finally exception
Even if a exception occurs , this block will execute after the try and catch blocks. It will always run
throw exception
YOU create an exception. This is a way to signal that an error has occurred in the code, allowing for custom error handling.
throws
Declares that a method might throw an exception.
unbounded wildcards
is ? = I dont know what type. It allows for flexibility in the type of objects that can be passed into a method or data structure, providing the ability to work with a range of object types.
EXAMPLE = ArrayList<?> list;
Upper Bounded Wildcards
A contract that specifies methods a class must implement, bounded up a limit = class animal to class dog. only accepts from this family tree, so car cant go into a animal class wilcard
Interfaces
are abstract types that allow for the definition of methods that must be implemented by any class that chooses to implement the interface. They enable polymorphism and provide a way to achieve multiple inheritance.
An interface describes WHAT to do, not HOW to do it.
Imagine you're hiring pilots.
You don't care:
how they fly
how they trained
what plane they use
You only care that:
They can fly()
They can land()So you make an interface: