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

JavaJava
9
חלקPart 2: מתודות ומערכיםMethods & arrays כ-3 שעות (כולל הפסקה)About 3 hours (with a break)

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

רשימה שגדלה לבד, מילון של מפתח וערך, טיפוסים עטופים (Integer) ו-autoboxing.

A list that grows by itself, a key-value map, wrapper types (Integer) and autoboxing.

בסוף המפגש תדעוBy the end you will

  • להשתמש ב-ArrayList: add, get, set, remove, size, containsUse an ArrayList: add, get, set, remove, size, contains
  • להשתמש ב-HashMap: put, get, getOrDefault, containsKey, ולעבור על keySet ו-entrySetUse a HashMap: put, get, getOrDefault, containsKey, and loop over keySet and entrySet
  • להבין <> וטיפוסים עוטפים (Integer) ו-autoboxingUnderstand <>, wrapper types (Integer) and autoboxing
  • לספור דברים עם מילוןCount things with a map
להתחיל בהרצאהStart the lecture

לפני שמתחיליםBefore you start

זמן: Time: כ-3 שעות (כולל הפסקה)About 3 hours (with a break)

דרישות קודמות: Prerequisites: מפגשים 1–8Sessions 1–8

מה צריך: You need: מחשב עם JDK 21 ו-IntelliJ IDEA מותקנים (מפגש 1). אפשר גם רק דפדפן: כל הקוד מוצג עם הפלט האמיתי שלו, ורץ גם כאן כשהדפדפן מאפשר.A computer with JDK 21 and IntelliJ IDEA (session 1). A browser alone also works: every example shows its real output, and runs here when the browser allows it.

סדר המפגשSession plan

  1. 0:00פתיחה וחזרה קצרהOpening and quick review
  2. 0:10מונחיםTerms
  3. 0:25ArrayList: רשימה שגדלהArrayList: a list that grows
  4. 0:40רשימה של מספרים: Integer ו-autoboxingA list of numbers: Integer and autoboxing
  5. 0:55רשימה היא עצם: שתי הפניותA list is an object: two references
  6. 1:10הפסקהBreak
  7. 1:20HashMap: מפתח וערךHashMap: key and value
  8. 1:35ספירה עם מילוןCounting with a map
  9. 1:50טעויות נפוצותCommon mistakes
  10. 2:05פרויקט מדףShelf project
  11. 2:20תרגולPractice
  12. 2:50סיכום ושאלותWrap-up and questions

רשימה שגדלה לבד, מילון של מפתח וערך, טיפוסים עטופים (Integer) ו-autoboxing. בסוף המפגש מוסיפים צעד לפרויקט המלווה.

A list that grows by itself, a key-value map, wrapper types (Integer) and autoboxing. At the end we add a step to the companion project.

הפרויקט המלווהThe companion project: מדף: ספרייה אישית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.

השלב של היוםToday's step המדף עובר ל-ArrayList, וספירת ספרים לפי סופרThe shelf moves to an ArrayList, plus a count of books per author. לתרגילGo to the exercise

מונחים חדשים במפגשNew terms in this session

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