Java 2 Rest of stuff Flashcards
treat primitives as objects. More specifically, they are the Class versions of your primitive types
This is necessary for when you NEED to use objects, and primitives aren’t allowed ie… collections
Wrapper classes
The ——- method returns the value of the attribute.
The —-method takes a parameter and assigns it to the attribute.
Getter
setter
allows for code that handles multiple data types
It’s another way of achieving polymorphism in java
Generics
Generics Take two forms in the code
One when ——— code that will provided a type value
And a different form when actually —–the value
Generics only work with reference ( one of the major reasons for the invention of the wrapper classes
writing
providing
The —– operator can be used for comparing references (addresses) and checks if the objects point to the same memory location
while the ———can be used to compare the content and it also compares the values of the objects.
==
.equals() method
———stores primitive types and the addresses of objects.
While ———- stores the value of the object.
Stack memory
Heap memory
the process of looking at heap memory, identifying which objects are in use and which are not, and deleting the unused objects.
Garbage collection
———- is the process of converting primitives into their wrapper class variants.
————– (turns a wrapper class into a primitive)
Boxing
autounboxing
Contains the code that you want to run that MAY result in an Exception being thrown.
Try Block
States the exception type that it can catch, then provides code to run when/if the Exception occurs
Catch Block
resource cleanup or if you want any specific thing to happen at the end of the try/catch
Finally Block
This is how you make ————. By creating a class that extends Exception or Unchecked Exception and and provide the necessary constructors and methods.
————– is used to explicitly throw an exception from a method or a block of code.
———- is used in a method declaration to indicate that the method might throw one or more exceptions.
throw
throws
——— are both techniques used to improve the performance of software applications by leveraging multiple processors or processor cores.
Parallelization and multithreading
———- involves concurrent execution of multiple threads within a single process, while
involves executing multiple processes or threads in parallel across multiple processors or processor cores.
multithreading
parallelization