Java 8, JDK/JRE/JIT, Maven,
Spring Core
An Overview of Key Java Concepts
Java 8: Lambda Expressions
• Lambda Expressions are anonymous functions.
• Syntax: (parameters) -> expression
• Example: (a, b) -> a + b
Java 8: Streams
• Stream API processes collections in a
functional style.
• Example: [Link]().filter(...).forEach(...);
Java 8: Filters
• Filter elements based on a condition.
• Example: [Link]().filter(x -> x % 2 ==
0).forEach(...);
Java 8: [Link] API
• New API for date and time manipulation.
• Example: [Link]()
Java 8: Optionals
• Container for optional (not-null) values.
• Avoids NullPointerExceptions.
• Example: [Link]("John").ifPresent(...);
Java 8: Asynchronous & Parallel
Programming
• Use CompletableFuture and parallel streams.
• Example: [Link](() ->
{...});
JDK vs JRE vs JIT
• JDK: Java Development Kit (development tools
+ JRE).
• JRE: Java Runtime Environment (JVM +
libraries).
• JIT: Just-In-Time Compiler (compiles bytecode
at runtime).
Maven: Needs & Benefits
• Build automation and dependency
management.
• Standardized project structure.
Maven: Project Creation &
[Link]
• Use mvn archetype:generate to create
projects.
• [Link] contains project configuration.
Maven: Build Lifecycle &
Repositories
• Phases: clean, default, site.
• Repositories: local, central, remote.
Maven: Scopes and Profiles
• Scopes: compile, test, provided.
• Profiles: customize builds for different
environments.
Spring Core: Dependency Injection
• Setter-based and constructor-based injection
supported.
• Promotes loose coupling.
Spring Core: Collections &
Dependency Check
• Inject List, Map, Set into beans.
• Dependency check ensures required
dependencies are injected.
Spring Core: Bean Scopes
• Scopes: singleton, prototype, request, session.
Spring Core: Autowiring &
Properties
• Autowiring injects dependencies
automatically.
• Use @Value to inject property values from
files.
Spring Core: Stereotype
Annotations
• @Component, @Service, @Repository,
@Controller
Spring Core: Injecting Interfaces
• Promotes abstraction and loose coupling.
• Inject dependencies using interfaces.