Mind map
Java

Map content
Java
handling error
- try-catch/finally statement
- try: contains code to execute
- catch: executes only if matching exception is thrown
- finally: contains code cleanup
- Throwable
- unchecked: no handling error is required but can
- checked: Should specify a block of code to execute when thrown
- recommendations
- go from specific to general exception
- own exception
- inherit from Exception class
- propagation
- methods
- 2 ways
- catch exception
- document (throws clause)
- 2 ways
- up the call stack
- methods
- try-catch/finally statement
Packages
- group of relates types, use packages to avoid name conflicts, and to write a better maintainable code
- categories
- built-in
- packages from the Java API
- User-defined Packages
- Java use a file system directory to store them
- Class files organized in hierarchical folders
- Java use a file system directory to store them
- built-in
- import
- On demand: The whole package
- Single type: Specific classes
- Safier: avoid confusions when classes in different packages share name
- Access boundary
- Outside package
- Inside package
- Archive file
- 1 single file which contains all class files and used to distribute our module
- JAR
- Can create using JDK (jar command line), Intellij, Maven
- optionally includes a manifest
interface
- defines a contract (no implementation)
- may contains
- methods
- implicity abstract
- static
- defined behavior
- can not be overriden
- accessibility
- through interface
- inside interface
- default
- accessibility
- through the instance of the implementing class
- an instance should be created
- can be overriden
- accessibility
- contants
- attibutes
- final by default
- can contain classes
- public BD
- final by default
- methods
- can extends
- interfaces only
Static
- attibute
- All instances access the same value
- method
- can access static field only
- there is no need to instanciate the object to call them
- can access static field only
- import
- specific method into other classes
- Initialization blocks
- at the top of the class definition, inside curly brakets
- have to handle checked exception
- class
- may has
- normal attributes
- normal methods
- may has
- attibute
Class
- abstract
- methods
- can implement behavior
- attributes
- may be non-final
- access modifiers: any
- extend
- classes
- implement
- multiple interfaces
- methods
- abstract
Modifiers
- final
- keep the value constant
- attibutes
- references
- allow to change the value of the pointed entity(String builder eg)
- classes
- not allowed to be extended
- methods
- doesn`t allow overring in extended classes
- final
versions features
- Java 8
- lambda expressions
- provides implementation of funcional interface
- interface with only one abstract method
- @FunctionalInterface notation
- interface with only one abstract method
- multiple arguments
- useful with collections
- provides implementation of funcional interface
- method references
- lambda expressions
- Java 8
tricks
- anonymous object
- use a method without assigning it to any reference
- anonymous object
Images and files in the map
Information
- Description
- Mind Map on Java, created by Jorge Celis on 18/09/2019.
- Created by
- Jorge Celis
- Views
- 5
- Rating



