Java 101: Explore and Learn



Table of Contents
Java 101: Explore and Learn
1. Version Control (Git)
-
• Git Basics: Repository setup, initialization (
git init), tracking changes (git status,git log), committing (git add,git commit). -
• Branching & Merging: Creating and switching branches (
git branch,git checkout,git switch), merging branches (git merge), and resolving merge conflicts. -
• Remote Repositories: Cloning (
git clone), managing remotes (git remote), pushing and pulling changes (git push,git pull). -
• Collaboration & Best Practices: Distributed version control benefits, commit message conventions, and structuring branches for teams (feature, hotfix).
-
• Git & Maven Integration: Maintaining proper Git workflows during builds and deployments.
2. Build Automation & Dependency Management (Maven)
-
• Maven Basics: Project building lifecycle, anatomy of Maven, and the
pom.xmlfile. -
• Dependency Management: Adding dependencies, utilizing the Maven Central Repository, and managing transitive dependencies.
-
• Build Automation & Lifecycle: Maven phases (clean, compile, test, package, verify, install), plugins, and packaging applications into
.jaror.warfiles.
3. Object-Oriented Programming (Java OOP)
-
• OOP Pillars & Relationships: Encapsulation (data hiding, getters/setters), Inheritance (single, multilevel), Polymorphism, and Abstraction. "Has-A" (Composition) vs. "Is-A" (Inheritance) relationships.
-
• Classes & Objects: Differences between classes and objects, object initialization, POJO (Plain Old Java Object), and concrete class vs. singleton class.
-
• Constructors & Inheritance: Default vs. parameterized constructors, constructor overloading, constructor chaining, the
thiskeyword, thesuperkeyword, andsupermethods. -
• Polymorphism in Depth: Method overloading vs. method overriding (when to override and when to call), early binding (static) vs. late binding (dynamic method dispatching). Static methods can be inherited but not overridden (field hiding).
-
• Abstraction & Interfaces: Abstract classes vs. interfaces (when to use which), implementation rules, types of interfaces (normal, marker, functional), and the Diamond Problem (how interfaces solve it).
-
• Immutability & Object Design: How to make anything immutable, how to make a class truly immutable, defensive copying, and deep copy vs. shallow copy.
-
• Nested & Inner Classes: Inner classes, nested classes, anonymous classes, anonymous inner classes, and static inner (nested) class vs. non-static inner class.
-
• Access Modifiers: Understanding
public,private,protected, anddefaultscopes.
4. Core Java Fundamentals & Syntax
-
• Data Types, Variables & Casting: Primitive vs. reference types, constants, literals, implicit/explicit type casting, and the
ObjectvsObjectsclass. -
• Wrapper Classes & Autoboxing: What wrapper classes are, their internal workings, and Autoboxing vs. Unboxing.
-
• Control Structures: Conditional statements (
if-else,switch) and looping constructs (for,while,do-while, enhancedfor-each). -
• Arrays: Single/multidimensional arrays, array initialization, and utility methods (
Arrays.equals,Arrays.deepEquals,Arrays.deepToString,Arrays.toString). -
• String Manipulation: Immutable strings (
String), mutable strings (StringBuffervsStringBuilder), thread safety differences, key API methods. -
• Object Equality: The
equals()method,hashCode()method, and the stricthashCode-equalscontract.
5. Advanced Java Concepts & Memory Management
-
• Keywords & Modifiers: Differences between
final(and "effectively final"),finallyblock, andfinalize()method. Usage ofstrictfp,volatile, and thestatickeyword (static variables, methods, blocks, and execution priority). -
• Exception Handling: Exception handling hierarchy,
try-catchblocks, differences betweenthrowandthrows, custom exceptions. -
• Generics: Concept of Generics, Wildcards vs. Generics, exceptions in wildcards, and types of variance (Contravariant, Invariant, Covariant).
-
• Multithreading & Concurrency: Concurrency and multithreading basics, the
Runnableinterface, ForkJoin pool, andAtomicInteger/ other atomic data types. -
• JVM, Classloaders & Memory Model:
text~• Memory Structure: Stack vs. Heap memory, Metaspace, `Class<>` objects. ~• Garbage Collection: GC working algorithms, manual triggering via `System.gc`. Types of reference variables (strong, weak, phantom, soft). ~• Classloaders: ClassLoader Subsystem, delegation hierarchy (bootstrap, platform, application classloaders), dynamic class loading, and lazy loading.
-
• Serialization & Reflection: The
Serializable(marker interface) andCloneableinterfaces, how marker interfaces are internally serializable, thetransientkeyword, and the Reflections API. -
• Annotations: Built-in annotations (
@Override,@Deprecated), what annotations are (@interface), where they are stored, and creating custom annotations.
6. Java Collections Framework & Data Structures
-
• Collections Framework Basics: What the framework is (
CollectionvsCollections), advantages over arrays, Collection hierarchy.Iterableinterface in collections,Iterableclass. -
• Lists: What is a List?
ArrayListvs.LinkedList(demonstrating differences, insertion working, complexity of operations),Vector, and working with legacy collections likeStack. -
• Sets: Internal working of Set (how it ensures no duplicates are added),
HashSetvs. Keys of theHashMap,TreeSetvs.TreeMap, Navigable Set, and Abstract Set. Why you can't use thesort()method on a Set. Converting a Set to an array. -
• Queues: Real-world use cases, Queues vs. Stacks (can we implement a queue using a linked list? Can we implement a stack using a queue?).
PriorityQueue,ArrayDeque. -
• Maps: Internal working of
HashMap(hashing, collisions, treeify/untreefy),HashTablevs.HashMap,WeakHashMapvs.IdentityHashMap,HashMapvs.ConcurrentHashMap(internal working and demonstration). -
• Iteration & Traversal:
IteratorvsIterable,ListIterator,Spliterator(e.g., splitting a reversed list of fruits). Fail-fast vs. Fail-safe iterators. -
• Sorting & Comparators: Natural ordering (
Comparable), custom logic (Comparator). Sorting aTreeMapin descending order. Sorting Maps by values (e.g., sorting a Map of Employee IDs to Marks). -
• Utility Classes & Operations:
java.util.Collections,asListvsList.ofvsArrays.toList(). -
• Practical Scenarios: Making two lists and performing union/intersection. Creating a custom class without overriding
hashCode/equalsand attempting to add those objects to a Set or Map.
7. Functional Programming & Streams (Java 8)
-
• Lambda Expressions: Syntax, capturing variables, Lambda expression vs. anonymous class, and the concept of "effectively final."
-
• Functional Interfaces: Core interfaces (
Predicate,Function,Consumer,Supplier,BinaryOperator/ Accumulator) and@FunctionalInterface. -
• Method References: Targeting static, instance, constructor, and arbitrary object methods.
-
• The Streams API (Concepts): Declarative data processing, Streams vs. Collections, Streams vs. Parallel Streams. Upstream vs. Downstream in Java. Intermediate vs. Terminal operations.
-
• Stream Operations & Collectors:
findFirstvs.findAny,.toList()vs.collect(Collectors.toList()), and the difference betweenpartitioningByandgroupingBy. -
• Practical Stream Applications:
text- 1) Converting a List into a Map using streams. - 2) Using streams to sort a list of strings representing weekdays. - 3) Finding 2-digit numbers, adding their digits, and printing them in a sorted manner.
-
• Null Handling: Preventing
NullPointerExceptionwithOptional<T>.
8. Structural Improvements & Modularity (Java 17)
-
• Records: Defining concise, immutable data objects. Passing Maps in records.
-
• Sealed Classes: Restricting subclassing to a predefined list using the
permitskeyword for strict architectural boundaries.
9. Syntactic Advancements & New Features (Java 21)
-
• Pattern Matching for
switch: Simplifying conditions with type patterns and combining type checks with smart casts. -
• Unnamed Patterns & Variables: Using the underscore (
_) for unused variables. -
• Unnamed Classes & Instance Main Methods: Simplifying prototypes and entry-point logic.
-
• String Templates: Seamlessly injecting values into strings with placeholders (
STR.). -
• Sequenced Collections: Maintaining insertion order for Maps and Sets efficiently with new interfaces.
Resources :
Git and Maven :
- • https://www.geeksforgeeks.org/git/top-12-most-used-git-commands-for-developers/
- • https://www.youtube.com/watch?v=8JJ101D3knE
- • https://git-scm.com/book/en/v2
- • https://docs.github.com/en/get-started
- • https://learngitbranching.js.org/
- • https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
- • https://www.youtube.com/watch?v=Xatr8AZLOsE
- • https://maven.apache.org/
- • https://mvnrepository.com/
- • https://www.youtube.com/watch?v=fy4adiZHqoo&list=PLS1QulWo1RIaLGvbwZCKPQBSy6I3Slamr
Object Oriented Programming :
- • https://docs.oracle.com/javase/tutorial/java/index.html
- • https://docs.oracle.com/javase/tutorial/java/concepts/
- • https://www.youtube.com/watch?v=bm0OyhwFDuY&list=PLsyeobzWxl7pe_IiTfNyr55kwJPWbgxB5
Core Java Essentials :
- • https://dev.java/learn/language-basics/
- • https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
- • https://www.tutorialspoint.com/java/java_type_casting.htm
- • https://www.geeksforgeeks.org/java/switch-statement-in-java/
- • https://www.tutorialspoint.com/java/java_loop_control.htm
- • https://www.baeldung.com/java-packages
- • https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
- • https://www.baeldung.com/java-string
- • https://www.tutorialspoint.com/java/java_strings.htm
- • https://www.baeldung.com/java-string-builder-string-buffer
- • https://www.geeksforgeeks.org/java/static-keyword-java/
- • https://www.geeksforgeeks.org/java/arrays-in-java/
- • https://www.baeldung.com/java-final-finally-finalize
- • https://www.tutorialspoint.com/java/java-autoboxing-unboxing.htm
- • https://www.geeksforgeeks.org/java/exceptions-in-java/
- • https://www.tutorialspoint.com/java/java_exceptions.htm
- • https://www.baeldung.com/java-default-annotations
- • https://medium.com/platform-engineer/understanding-java-memory-model-1d0863f6d973
- • https://www.baeldung.com/java-stack-heap
Collections Framework :
- • https://docs.oracle.com/javase/tutorial/collections/intro/index.html
- • https://www.geeksforgeeks.org/java/difference-between-arrays-and-collection-in-java/
- • https://bytebytego.com/guides/java-collection-hierarchy/
- • https://www.geeksforgeeks.org/java/java-collection-tutorial/
- • https://www.baeldung.com/java-arraylist-linkedlist
- • https://www.tutorialspoint.com/java/util/java_util_stack.htm
- • https://docs.oracle.com/javase/tutorial/collections/interfaces/set.html
- • https://docs.oracle.com/javase/8/docs/api/java/util/HashSet.html
- • https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashSet.html
- • https://www.baeldung.com/java-tree-set
- • https://www.tutorialspoint.com/java/java_using_iterator.htm
- • https://www.baeldung.com/java-spliterator
- • https://www.javaspring.net/blog/java-concurrent-modification-exception/
- • https://www.baeldung.com/java-concurrentmodificationexception
- • https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html
- • https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html
- • https://www.baeldung.com/java-comparator-comparable
- • https://www.geeksforgeeks.org/java/queue-interface-java/
- • https://docs.oracle.com/javase/8/docs/api/java/util/Queue.html
- • https://docs.oracle.com/javase/8/docs/api/java/util/Deque.html
- • https://www.geeksforgeeks.org/java/priority-queue-in-java/
- • https://www.baeldung.com/java-array-deque
- • https://docs.oracle.com/javase/8/docs/api/java/util/Map.html
- • https://codegym.cc/quests/lectures/questcollections.level07.lecture05
- • https://www.baeldung.com/java-hashmap-advanced
- • https://www.baeldung.com/java-treemap
- • https://www.baeldung.com/java-linked-hashmap
- • https://www.baeldung.com/java-weakhashmap
- • https://www.geeksforgeeks.org/java/collections-class-in-java/
- • https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html
- • https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html
- • https://www.geeksforgeeks.org/dsa/analysis-algorithms-big-o-analysis/
- • https://www.baeldung.com/java-collections-complexity
Key Java Features:
- • https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
- • https://www.tutorialspoint.com/java/java-lambda-expressions.htm
- • https://www.baeldung.com/java-8-functional-interfaces
- • https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html
- • https://www.geeksforgeeks.org/java/java-8-optional-class/
- • https://www.baeldung.com/java-optional
- • https://docs.oracle.com/javase/tutorial/collections/streams/index.html
- • https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html
- • https://www.baeldung.com/java-8-streams
- • https://www.baeldung.com/java-collectors
- • https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html
- • https://www.tutorialspoint.com/java/java_method_references.htm
- • https://docs.oracle.com/en/java/javase/17/language/records.html
- • https://www.baeldung.com/java-record-keyword
- • https://docs.oracle.com/en/java/javase/17/language/sealed-classes-and-interfaces.html
- • https://www.baeldung.com/java-sealed-classes-interfaces
- • https://docs.oracle.com/en/java/javase/21/language/pattern-matching-switch.html
- • https://www.baeldung.com/java-switch-pattern-matching
- • https://docs.oracle.com/en/java/javase/21/language/unnamed-variables-and-patterns.html
- • https://docs.oracle.com/en/java/javase/21/language/implicitly-declared-classes-and-instance-main-methods.html
- • https://docs.oracle.com/en/java/javase/21/language/string-templates.html
- • https://docs.oracle.com/en/java/javase/21/core/creating-sequenced-collections-sets-and-maps.html