נבנה על ידיBuilt by Ariel Yohimovich

JavaJava

Java

קורס Java מלא בעברית: מהשורה הראשונה, דרך OOP, טיפוסים ו-Generics, ועד Threads, שרתים ומשחקים.

A complete Java course: from your first line, through OOP, types and generics, to threads, servers and games.

1. מה זה תכנות? JVM, JDK, IntelliJ ו-jshell / What is programming? JVM, JDK, IntelliJ & jshell2. משתנים וטיפוסים פרימיטיביים / Variables & primitive types3. String ו-StringBuilder / String & StringBuilder4. תנאים ו-switch החדש / Conditions & the new switch5. לולאות / Loops6. Scanner וקלט / Scanner & input7. מתודות, overloading ו-pass-by-value / Methods, overloading & pass-by-value8. מערכים ומערכים דו-ממדיים / Arrays & 2D arrays9. ArrayList ו-HashMap ראשונים / First ArrayList & HashMap10. static מול instance / static vs instance11. דיבוג ב-IntelliJ / Debugging in IntelliJ12. חריגות בסיסיות / Basic exceptions13. מחלקות ועצמים / Classes & objects14. בנאים ו-this / Constructors & this15. Encapsulation, getters, setters ו-immutability / Encapsulation, getters, setters & immutability16. static, final וקבועים / static, final & constants17. equals, hashCode ו-toString / equals, hashCode & toString18. פרויקט קטן: המדף כמערכת מחלקות / Mini project: the shelf as classes19. ירושה, super ו-override / Inheritance, super & override20. abstract ו-interfaces / abstract & interfaces21. פולימורפיזם ו-dynamic dispatch / Polymorphism & dynamic dispatch22. Generics / Generics23. records, enums, sealed ו-pattern matching / records, enums, sealed & pattern matching24. SOLID ותבניות עיצוב / SOLID & design patterns25. Collections לעומק / Collections in depth26. Lambdas ו-functional interfaces / Lambdas & functional interfaces27. Streams ו-Optional / Streams & Optional28. חריגות checked מול unchecked ו-try-with-resources / Checked vs unchecked exceptions & try-with-resources29. קבצים עם NIO ו-JSON / Files with NIO & JSON30. JUnit 5, Maven, Gradle ו-Git / JUnit 5, Maven, Gradle & Git31. Thread ו-Runnable, start מול run, ו-join / Thread & Runnable, start vs run, and join32. Race conditions, synchronized ומוניטורים / Race conditions, synchronized & monitors33. volatile ו-Java Memory Model / volatile & the Java Memory Model34. wait/notify, producer/consumer ו-BlockingQueue / wait/notify, producer/consumer & BlockingQueue35. ExecutorService, thread pools, Callable ו-Future / ExecutorService, thread pools, Callable & Future36. Locks, Atomic ו-ConcurrentHashMap / Locks, Atomic & ConcurrentHashMap37. CompletableFuture ו-virtual threads / CompletableFuture & virtual threads38. Deadlock, livelock ו-starvation / Deadlock, livelock & starvation39. JDBC ו-HttpClient / JDBC & HttpClient40. Spring Boot REST עם בדיקות / Spring Boot REST with tests41. Java בעידן ה-AI / Java in the AI era42. אלגוריתמים, ראיון עבודה ופרויקט גמר / Algorithms, interviews & final project43. חלון ראשון: Swing, ציור ו-game loop / First window: Swing, drawing & the game loop44. קלט מקלדת ועכבר / Keyboard & mouse input45. התנגשויות ו-sprites / Collisions & sprites46. מצבי משחק: תפריט, משחק ו-Game Over / Game states: menu, play & game over47. Thread ללוגיקה ול-render, עם סנכרון / A thread for logic and rendering, with sync48. משחק שלם ואריזה ל-jar ו-jpackage / A full game, packed with jar & jpackage123456781713192531374348123456781713192531374348
מדף: ספרייה אישיתShelf: a personal library. פרויקט אחד שגדל איתכם לאורך כל הקורס: מתחיל כתוכנית של 10 שורות, הופך למחלקות, ל-interfaces ול-streams, מייבא ספרים במקביל עם Threads, ונגמר כ-REST API.One project that grows with you through the whole course: it starts as a 10-line program, becomes classes, interfaces and streams, imports books in parallel with threads, and ends as a REST API. בחלק 8 כל מפגש בונה משחק חדש.In part 8 every session builds a new game.

כל המפגשיםAll sessions

חלקPart 1: יסודותFoundations

מה זה תכנות, JVM ו-JDK, IntelliJ ו-jshell, משתנים וטיפוסים, מחרוזות, תנאים, לולאות וקלט.

What programming is, the JVM and the JDK, IntelliJ and jshell, variables and types, strings, conditions, loops and input.

1

מה זה תכנות? JVM, JDK, IntelliJ ו-jshellWhat is programming? JVM, JDK, IntelliJ & jshell

איך מחשב מבצע הוראות, איך Java רצה (קוד, javac, bytecode, JVM), התקנת JDK ו-IntelliJ ב-Windows וב-Mac, jshell, והתוכנית הראשונה.How a computer follows instructions, how Java runs (source, javac, bytecode, the JVM), installing the JDK and IntelliJ on Windows and Mac, jshell, and a first program.

בפרויקט: Project: תוכנית ראשונה: באנר פתיחה וספר אחד על המסךFirst program: a welcome banner and one book on screen
2

משתנים וטיפוסים פרימיטיבייםVariables & primitive types

int, double, boolean, char ו-long, var, המרות טיפוסים, גלישה (overflow) וחלוקה של מספרים שלמים.int, double, boolean, char and long, var, type conversions, overflow and integer division.

בפרויקט: Project: משתנים לספר: שם, שנה ודירוגVariables for a book: title, year and rating
3

String ו-StringBuilderString & StringBuilder

מחרוזות הן עצמים שלא משתנים, מתודות שימושיות, השוואה עם equals, String.format ו-StringBuilder לבנייה יעילה.Strings are immutable objects, useful methods, comparing with equals, String.format, and StringBuilder for efficient building.

בפרויקט: Project: כרטיס ספר מעוצב עם String.formatA formatted book card with String.format
4

תנאים ו-switch החדשConditions & the new switch

if, else if ו-else, אופרטורים לוגיים, switch עם חצים (->) כביטוי שמחזיר ערך, ו-yield.if, else if and else, logical operators, switch with arrows (->) as an expression that returns a value, and yield.

בפרויקט: Project: דירוג במילים לפי מספר הכוכביםA rating in words from the number of stars
5

לולאותLoops

for, while, do-while ו-for-each, break ו-continue, לולאות מקוננות ומעקב אחרי משתני לולאה.for, while, do-while and for-each, break and continue, nested loops and tracing loop variables.

בפרויקט: Project: הדפסת רשימת ספרים ממוספרתPrinting a numbered list of books
6

Scanner וקלטScanner & input

קריאת קלט עם Scanner, nextLine מול nextInt והמלכודת שביניהם, בדיקת קלט ותפריט טקסט ראשון.Reading input with Scanner, nextLine vs nextInt and the trap between them, validating input and a first text menu.

בפרויקט: Project: תפריט: הוספת ספר והצגת המדףA menu: add a book and show the shelf

חלקPart 2: מתודות ומערכיםMethods & arrays

מתודות ו-pass-by-value, מערכים, ArrayList ו-HashMap ראשונים, static, דיבוג וחריגות.

Methods and pass-by-value, arrays, first ArrayList and HashMap, static, debugging and exceptions.

7

מתודות, overloading ו-pass-by-valueMethods, overloading & pass-by-value

הגדרת מתודות, פרמטרים וערך החזרה, overloading, ומה באמת עובר למתודה: עותק של הערך, גם כשהערך הוא הפניה.Defining methods, parameters and return values, overloading, and what really reaches a method: a copy of the value, even when the value is a reference.

בפרויקט: Project: מתודות להדפסה ולחישוב ממוצע דירוגיםMethods to print and to average the ratings
8

מערכים ומערכים דו-ממדייםArrays & 2D arrays

יצירה, גישה ואורך, לולאות על מערכים, Arrays.toString ו-sort, ומערכים דו-ממדיים כמו לוח משחק.Creating, accessing and length, looping over arrays, Arrays.toString and sort, and 2D arrays like a game board.

בפרויקט: Project: מערך של שמות ספרים ומיון שלוAn array of book titles, sorted
9

ArrayList ו-HashMap ראשוניםFirst ArrayList & HashMap

רשימה שגדלה לבד, מילון של מפתח וערך, טיפוסים עטופים (Integer) ו-autoboxing.A list that grows by itself, a key-value map, wrapper types (Integer) and autoboxing.

בפרויקט: Project: המדף עובר ל-ArrayList, וספירת ספרים לפי סופרThe shelf moves to an ArrayList, plus a count of books per author
10

static מול instancestatic vs instance

מה שייך למחלקה ומה שייך לעצם, מתי static הגיוני, ולמה main הוא static.What belongs to the class and what belongs to an object, when static makes sense, and why main is static.

בפרויקט: Project: מתודות עזר סטטיות למדףStatic helper methods for the shelf
11

דיבוג ב-IntelliJDebugging in IntelliJ

נקודות עצירה, Step Over ו-Step Into, צפייה במשתנים, קריאת stack trace ושיטה למציאת באגים.Breakpoints, Step Over and Step Into, watching variables, reading a stack trace and a method for finding bugs.

בפרויקט: Project: מוצאים ומתקנים 3 באגים במדףFind and fix 3 bugs in the shelf
12

חריגות בסיסיותBasic exceptions

מה זו חריגה, try, catch ו-finally, זריקה עם throw, והודעות שגיאה שעוזרות.What an exception is, try, catch and finally, throwing with throw, and error messages that help.

בפרויקט: Project: קלט עמיד: שנה לא חוקית לא מפילה את המדףRobust input: a bad year doesn't crash the shelf

חלקPart 3: OOP: היסודותOOP: the basics

מחלקות ועצמים, בנאים, encapsulation, static ו-final, equals ו-hashCode, ופרויקט קטן.

Classes and objects, constructors, encapsulation, static and final, equals and hashCode, and a small project.

13

מחלקות ועצמיםClasses & objects

מחלקה כתבנית ועצם כמופע, שדות ומתודות, new, והפניות בזיכרון (stack מול heap).A class as a blueprint and an object as an instance, fields and methods, new, and references in memory (stack vs heap).

בפרויקט: Project: המחלקה BookThe Book class
14

בנאים ו-thisConstructors & this

בנאים, overloading של בנאים, this() ו-this.field, וסדר האתחול.Constructors, constructor overloading, this() and this.field, and initialization order.

בפרויקט: Project: בנאים ל-Book עם ערכי ברירת מחדלBook constructors with defaults
15

Encapsulation, getters, setters ו-immutabilityEncapsulation, getters, setters & immutability

private ו-public, שמירה על מצב תקין, getters ו-setters במידה, ועצמים שלא משתנים.private and public, keeping state valid, getters and setters in moderation, and objects that never change.

בפרויקט: Project: Book מוגן: דירוג תמיד בין 1 ל-5A protected Book: rating always between 1 and 5
16

static, final וקבועיםstatic, final & constants

שדות static משותפים, final למשתנים, לשדות ולמחלקות, וקבועים בשמות גדולים.Shared static fields, final for variables, fields and classes, and constants in capital letters.

בפרויקט: Project: מונה ספרים וקבועי דירוגA book counter and rating constants
17

equals, hashCode ו-toStringequals, hashCode & toString

== מול equals, החוזה בין equals ל-hashCode, ולמה HashSet מתבלבל בלעדיהם. toString שעוזר לדבג.== vs equals, the contract between equals and hashCode, and why a HashSet gets confused without them. A toString that helps debugging.

בפרויקט: Project: ספרים כפולים לא נכנסים למדףDuplicate books stay off the shelf
18

פרויקט קטן: המדף כמערכת מחלקותMini project: the shelf as classes

מתכננים ובונים יחד את Shelf, Book ו-Author: אחריות לכל מחלקה, ממשק נקי ובדיקה ידנית.Designing and building Shelf, Book and Author together: one job per class, a clean interface and manual testing.

בפרויקט: Project: Shelf, Book ו-Author עובדים יחדShelf, Book and Author working together

חלקPart 4: OOP מתקדםAdvanced OOP

ירושה, interfaces, פולימורפיזם, Generics, records, sealed ו-pattern matching, ותבניות עיצוב.

Inheritance, interfaces, polymorphism, generics, records, sealed types and pattern matching, and design patterns.

19

ירושה, super ו-overrideInheritance, super & override

extends, super() ו-super.method(), @Override, ומתי ירושה היא רעיון רע.extends, super() and super.method(), @Override, and when inheritance is a bad idea.

בפרויקט: Project: EBook ו-AudioBook יורשים מ-BookEBook and AudioBook extend Book
20

abstract ו-interfacesabstract & interfaces

מחלקות מופשטות, interfaces עם default ו-static methods, ומימוש של כמה interfaces.Abstract classes, interfaces with default and static methods, and implementing several interfaces.

בפרויקט: Project: interface בשם LendableA Lendable interface
21

פולימורפיזם ו-dynamic dispatchPolymorphism & dynamic dispatch

הפניה מטיפוס אחד ועצם מטיפוס אחר, איזו מתודה נבחרת בזמן ריצה, casting ו-instanceof.A reference of one type and an object of another, which method is chosen at run time, casting and instanceof.

בפרויקט: Project: רשימה אחת של כל סוגי הפריטים במדףOne list of every kind of shelf item
22

GenericsGenerics

מחלקות ומתודות גנריות, bounded types, wildcards ו-PECS, ו-type erasure.Generic classes and methods, bounded types, wildcards and PECS, and type erasure.

בפרויקט: Project: Shelf<T> גנריA generic Shelf<T>
23

records, enums, sealed ו-pattern matchingrecords, enums, sealed & pattern matching

records לנתונים, enums עם התנהגות, sealed interfaces, ו-switch עם תבניות (Java 21).records for data, enums with behavior, sealed interfaces, and switch with patterns (Java 21).

בפרויקט: Project: סוגי פריטים כ-sealed ו-recordsItem kinds as sealed types and records
24

SOLID ותבניות עיצובSOLID & design patterns

חמשת עקרונות SOLID, ו-Strategy, Factory, Builder, Observer ו-Singleton (והבעיות שלו).The five SOLID principles, plus Strategy, Factory, Builder, Observer and Singleton (and its problems).

בפרויקט: Project: מיון לפי Strategy ו-Builder לספרSorting by Strategy and a Builder for books

חלקPart 5: Java מודרנית וכליםModern Java & tools

Collections לעומק, lambdas, Streams ו-Optional, חריגות, קבצים ו-JSON, JUnit, Maven, Gradle ו-Git.

Collections in depth, lambdas, streams and Optional, exceptions, files and JSON, JUnit, Maven, Gradle and Git.

25

Collections לעומקCollections in depth

List, Set, Map ו-Queue, מימושים שונים, סיבוכיות זמן, ומתי לבחור מה.List, Set, Map and Queue, different implementations, time complexity, and when to choose which.

בפרויקט: Project: אינדקס מהיר לפי סופר וז'אנרA fast index by author and genre
26

Lambdas ו-functional interfacesLambdas & functional interfaces

ביטויי למבדה, Function, Predicate, Consumer ו-Supplier, ו-method references.Lambda expressions, Function, Predicate, Consumer and Supplier, and method references.

בפרויקט: Project: סינון ספרים עם PredicateFiltering books with a Predicate
27

Streams ו-OptionalStreams & Optional

filter, map, reduce ו-collect, groupingBy, ו-Optional במקום null.filter, map, reduce and collect, groupingBy, and Optional instead of null.

בפרויקט: Project: סטטיסטיקות המדף בשורה אחתShelf statistics in one line
28

חריגות checked מול unchecked ו-try-with-resourcesChecked vs unchecked exceptions & try-with-resources

היררכיית החריגות, throws, חריגות משלכם, ו-try-with-resources שסוגר משאבים לבד.The exception hierarchy, throws, your own exceptions, and try-with-resources that closes resources by itself.

בפרויקט: Project: חריגה BookNotFoundExceptionA BookNotFoundException
29

קבצים עם NIO ו-JSONFiles with NIO & JSON

Path ו-Files, קריאה וכתיבה של טקסט, CSV, ושמירה וטעינה של JSON.Path and Files, reading and writing text, CSV, and saving and loading JSON.

בפרויקט: Project: המדף נשמר לקובץ ונטען ממנוThe shelf saves to a file and loads from it
30

JUnit 5, Maven, Gradle ו-GitJUnit 5, Maven, Gradle & Git

בדיקות אוטומטיות עם JUnit 5, פרויקט Maven או Gradle, ניהול תלויות, ו-Git ו-GitHub.Automated tests with JUnit 5, a Maven or Gradle project, dependencies, and Git and GitHub.

בפרויקט: Project: בדיקות JUnit למדף ופרויקט MavenJUnit tests for the shelf and a Maven project

חלקPart 6: Concurrency ו-ThreadsConcurrency & threads

לב הקורס המתקדם: Threads, race conditions, synchronized, זיכרון משותף, תורים, thread pools, CompletableFuture, virtual threads ו-deadlock.

The heart of the advanced course: threads, race conditions, synchronized, shared memory, queues, thread pools, CompletableFuture, virtual threads and deadlock.

31

Thread ו-Runnable, start מול run, ו-joinThread & Runnable, start vs run, and join

מה זה thread, יצירה עם Runnable ולמבדה, ההבדל בין start ל-run, join, ומצבי ה-thread.What a thread is, creating one with Runnable and lambdas, the difference between start and run, join, and thread states.

בפרויקט: Project: טעינת שני קבצי ספרים במקבילLoading two book files at the same time
32

Race conditions, synchronized ומוניטוריםRace conditions, synchronized & monitors

למה count++ מאבד עדכונים, קטע קריטי, synchronized על מתודות ועל בלוקים, ומוניטורים.Why count++ loses updates, critical sections, synchronized methods and blocks, and monitors.

בפרויקט: Project: מונה השאלות בטוח ל-threadsA thread-safe loan counter
33

volatile ו-Java Memory Modelvolatile & the Java Memory Model

נראות (visibility), happens-before, volatile, ומתי הוא לא מספיק.Visibility, happens-before, volatile, and when it isn't enough.

בפרויקט: Project: דגל עצירה נכון לייבוא ארוךA correct stop flag for a long import
34

wait/notify, producer/consumer ו-BlockingQueuewait/notify, producer/consumer & BlockingQueue

המתנה לתנאי עם wait ו-notify, תבנית יצרן-צרכן, ו-BlockingQueue שעושה את זה בשבילכם.Waiting for a condition with wait and notify, the producer-consumer pattern, and BlockingQueue that does it for you.

בפרויקט: Project: תור ייבוא: קורא אחד וכמה מעבדיםAn import queue: one reader and several processors
35

ExecutorService, thread pools, Callable ו-FutureExecutorService, thread pools, Callable & Future

בריכת threads, משימות עם תוצאה, Future.get, invokeAll, וסגירה מסודרת.Thread pools, tasks with a result, Future.get, invokeAll, and an orderly shutdown.

בפרויקט: Project: ייבוא מקבילי של ספרים עם ExecutorServiceParallel book import with an ExecutorService
36

Locks, Atomic ו-ConcurrentHashMapLocks, Atomic & ConcurrentHashMap

ReentrantLock ו-ReadWriteLock, AtomicInteger ו-compareAndSet, ו-ConcurrentHashMap.ReentrantLock and ReadWriteLock, AtomicInteger and compareAndSet, and ConcurrentHashMap.

בפרויקט: Project: מטמון thread-safe לפרטי ספריםA thread-safe cache for book details
37

CompletableFuture ו-virtual threadsCompletableFuture & virtual threads

שרשראות אסינכרוניות עם CompletableFuture, טיפול בשגיאות, ו-virtual threads של Java 21 לאלפי משימות.Asynchronous chains with CompletableFuture, error handling, and Java 21 virtual threads for thousands of tasks.

בפרויקט: Project: ייבוא עם CompletableFuture ו-virtual threadsImport with CompletableFuture and virtual threads
38

Deadlock, livelock ו-starvationDeadlock, livelock & starvation

איך threads נתקעים, איך מאבחנים עם jstack ו-thread dump, ואיך מונעים: סדר מנעולים, tryLock וזמנים קצובים.How threads get stuck, how to diagnose with jstack and a thread dump, and how to prevent it: lock ordering, tryLock and timeouts.

בפרויקט: Project: השאלה בין שני מדפים בלי deadlockLending between two shelves without deadlock

חלקPart 7: Java בעולם האמיתיJava in the real world

מסדי נתונים ו-HTTP, Spring Boot, עבודה עם מודל שפה, אלגוריתמים, ראיון עבודה ופרויקט גמר.

Databases and HTTP, Spring Boot, working with a language model, algorithms, job interviews and a final project.

חלקPart 8: משחקים ב-JavaGames in Java

6 מפגשים עם Swing ו-Java2D: game loop, קלט, התנגשויות, מצבי משחק, Thread נפרד ללוגיקה ול-render, ומשחק שלם שנארז ל-jar.

6 sessions with Swing and Java2D: the game loop, input, collisions, game states, a separate thread for logic and rendering, and a full game packed into a jar.

43

חלון ראשון: Swing, ציור ו-game loopFirst window: Swing, drawing & the game loop

JFrame ו-JPanel, ציור עם Graphics2D, וה-game loop: עדכון, ציור, המתנה.JFrame and JPanel, drawing with Graphics2D, and the game loop: update, draw, wait.

בפרויקט: Project: משחק 1: כדורים קופציםGame 1: bouncing balls
44

קלט מקלדת ועכברKeyboard & mouse input

KeyListener, מצב מקשים לתנועה חלקה, עכבר, ומהירות שלא תלויה במחשב (delta time).KeyListener, key state for smooth movement, the mouse, and speed that doesn't depend on the computer (delta time).

בפרויקט: Project: משחק 2: חללית שזזהGame 2: a moving spaceship
45

התנגשויות ו-spritesCollisions & sprites

מלבנים ועיגולים שמתנגשים, sprites מתמונות, אנימציה מפריימים וניקוד.Rectangles and circles that collide, sprites from images, frame animation and scoring.

בפרויקט: Project: משחק 3: לתפוס כוכביםGame 3: catch the stars
46

מצבי משחק: תפריט, משחק ו-Game OverGame states: menu, play & game over

מכונת מצבים עם enum, מסכים, שמירת שיא, וקול.A state machine with an enum, screens, a saved high score, and sound.

בפרויקט: Project: משחק 4: משחק עם תפריט ושיאGame 4: a game with a menu and a high score
47

Thread ללוגיקה ול-render, עם סנכרוןA thread for logic and rendering, with sync

מפרידים את הלוגיקה מהציור ל-threads נפרדים, משתפים מצב בבטחה, ומשווים ל-Swing Timer.Separating logic from drawing into their own threads, sharing state safely, and comparing with a Swing Timer.

בפרויקט: Project: משחק 5: עולם עם הרבה אויביםGame 5: a world with many enemies
48

משחק שלם ואריזה ל-jar ו-jpackageA full game, packed with jar & jpackage

מחברים הכול למשחק שלם, אורזים ל-jar שרץ בלחיצה כפולה, ויוצרים מתקין עם jpackage.Putting it all into a full game, packing a jar that runs on double-click, and making an installer with jpackage.

בפרויקט: Project: משחק 6: המשחק שלכם, ארוז ומוכןGame 6: your game, packed and ready

נבנה על ידיBuilt by Ariel Yohimovich