[{"data":1,"prerenderedAt":4259},["ShallowReactive",2],{"item-lessons-light-ch17-inheritance-and-abstractions":3,"item-examples-light-ch17-inheritance-and-abstractions":444,"item-exercises-light-ch17-inheritance-and-abstractions":753,"item-lesson-full-ch17-inheritance-and-abstractions-17.4":1070,"item-example-full-ch17-inheritance-and-abstractions-17.4":1924,"item-exercise-full-ch17-inheritance-and-abstractions-17.4":2840},[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,304,308,312,316,320,324,328,332,336,340,344,348,352,356,360,364,368,372,376,380,384,388,392,396,400,404,408,412,416,420,424,428,432,436,440],{"path":5,"title":6,"stem":7},"\u002Fshockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1-why-java-for-frc","Why Java for FRC?","shockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1.1-why-java-for-frc",{"path":9,"title":10,"stem":11},"\u002Fshockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers","shockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":13,"title":14,"stem":15},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":17,"title":18,"stem":19},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":21,"title":22,"stem":23},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":25,"title":26,"stem":27},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":29,"title":30,"stem":31},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":33,"title":34,"stem":35},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":37,"title":38,"stem":39},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":41,"title":42,"stem":43},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":45,"title":46,"stem":47},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":49,"title":50,"stem":51},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":53,"title":54,"stem":55},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":57,"title":58,"stem":59},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":61,"title":62,"stem":63},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":65,"title":66,"stem":67},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":69,"title":70,"stem":71},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","Control Structures: if Statements & For Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":73,"title":74,"stem":75},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":77,"title":78,"stem":79},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":81,"title":82,"stem":83},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":85,"title":86,"stem":87},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":89,"title":90,"stem":91},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":93,"title":94,"stem":95},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":97,"title":98,"stem":99},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":101,"title":102,"stem":103},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws)","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":105,"title":106,"stem":107},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F8-while-loops","While Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.8-while-loops",{"path":109,"title":110,"stem":111},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":113,"title":114,"stem":115},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F1-strings","Strings","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.1-strings",{"path":117,"title":118,"stem":119},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F2-string-algorithms","String Algorithms","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.2-string-algorithms",{"path":121,"title":122,"stem":123},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","The Class Blueprint","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":125,"title":126,"stem":127},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":129,"title":130,"stem":131},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":133,"title":134,"stem":135},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":137,"title":138,"stem":139},"\u002Fshockwave-curriculum\u002Flessons\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\"","shockwave-curriculum\u002Flessons\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":141,"title":142,"stem":143},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":145,"title":146,"stem":147},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":149,"title":150,"stem":151},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":153,"title":154,"stem":155},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":157,"title":158,"stem":159},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":161,"title":162,"stem":163},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":165,"title":166,"stem":167},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":169,"title":170,"stem":171},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":173,"title":174,"stem":175},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":177,"title":178,"stem":179},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":181,"title":182,"stem":183},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":185,"title":186,"stem":187},"\u002Fshockwave-curriculum\u002Flessons\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices","shockwave-curriculum\u002Flessons\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":189,"title":190,"stem":191},"\u002Fshockwave-curriculum\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch","shockwave-curriculum\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":193,"title":194,"stem":195},"\u002Fshockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas","shockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":197,"title":198,"stem":199},"\u002Fshockwave-curriculum\u002Flessons\u002Fch14-why-design-patterns\u002F14-why-design-patterns","Why Design Patterns?","shockwave-curriculum\u002Flessons\u002Fch14-why-design-patterns\u002F14-why-design-patterns",{"path":201,"title":202,"stem":203},"\u002Fshockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap)","shockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":205,"title":206,"stem":207},"\u002Fshockwave-curriculum\u002Flessons\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics","shockwave-curriculum\u002Flessons\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":209,"title":210,"stem":211},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":213,"title":214,"stem":215},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":217,"title":218,"stem":219},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":221,"title":222,"stem":223},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":225,"title":226,"stem":227},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":229,"title":230,"stem":231},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":233,"title":234,"stem":235},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":237,"title":238,"stem":239},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":241,"title":242,"stem":243},"\u002Fshockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts","shockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":245,"title":246,"stem":247},"\u002Fshockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References","shockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":249,"title":250,"stem":251},"\u002Fshockwave-curriculum\u002Flessons\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern","shockwave-curriculum\u002Flessons\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":253,"title":254,"stem":255},"\u002Fshockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories","Static Factories","shockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories",{"path":257,"title":258,"stem":259},"\u002Fshockwave-curriculum\u002Flessons\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern","shockwave-curriculum\u002Flessons\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":261,"title":262,"stem":263},"\u002Fshockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability","shockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":265,"title":266,"stem":267},"\u002Fshockwave-curriculum\u002Flessons\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions","shockwave-curriculum\u002Flessons\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":269,"title":270,"stem":271},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming?","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":273,"title":274,"stem":275},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":277,"title":278,"stem":279},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":281,"title":282,"stem":283},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":285,"title":286,"stem":287},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":289,"title":290,"stem":291},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":293,"title":294,"stem":295},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":297,"title":298,"stem":299},"\u002Fshockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways","shockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":301,"title":302,"stem":303},"\u002Fshockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design","shockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":305,"title":306,"stem":307},"\u002Fshockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F2-impact-of-program-design","Impact of Program Design","shockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F27.2-impact-of-program-design",{"path":309,"title":310,"stem":311},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":313,"title":314,"stem":315},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":317,"title":318,"stem":319},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":321,"title":322,"stem":323},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",{"path":325,"title":326,"stem":327},"\u002Fshockwave-curriculum\u002Flessons\u002Fch29-git-and-github-basics\u002F1-coming-soon","Git & GitHub Basics — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch29-git-and-github-basics\u002F29.1-coming-soon",{"path":329,"title":330,"stem":331},"\u002Fshockwave-curriculum\u002Flessons\u002Fch30-git-history-and-merging\u002F1-coming-soon","Git — History & Merging — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch30-git-history-and-merging\u002F30.1-coming-soon",{"path":333,"title":334,"stem":335},"\u002Fshockwave-curriculum\u002Flessons\u002Fch31-dev-environment-and-tooling\u002F1-coming-soon","Dev Environment & Tooling — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch31-dev-environment-and-tooling\u002F31.1-coming-soon",{"path":337,"title":338,"stem":339},"\u002Fshockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F1-coming-soon","Unit Testing — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F32.1-coming-soon",{"path":341,"title":342,"stem":343},"\u002Fshockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F1-coming-soon","AdvantageKit — AutoLogging — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F33.1-coming-soon",{"path":345,"title":346,"stem":347},"\u002Fshockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F1-coming-soon","Log Replay — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F34.1-coming-soon",{"path":349,"title":350,"stem":351},"\u002Fshockwave-curriculum\u002Flessons\u002Fch35-advantagescope-i-visualization\u002F1-coming-soon","AdvantageScope I: Visualization — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch35-advantagescope-i-visualization\u002F35.1-coming-soon",{"path":353,"title":354,"stem":355},"\u002Fshockwave-curriculum\u002Flessons\u002Fch36-advantagescope-ii-custom-3d-assets\u002F1-coming-soon","AdvantageScope II: Custom 3D Assets — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch36-advantagescope-ii-custom-3d-assets\u002F36.1-coming-soon",{"path":357,"title":358,"stem":359},"\u002Fshockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F1-coming-soon","Autonomous I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F37.1-coming-soon",{"path":361,"title":362,"stem":363},"\u002Fshockwave-curriculum\u002Flessons\u002Fch38-autonomous-ii-pathplanner-and-trajectories\u002F1-coming-soon","Autonomous II: PathPlanner & Trajectories — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch38-autonomous-ii-pathplanner-and-trajectories\u002F38.1-coming-soon",{"path":365,"title":366,"stem":367},"\u002Fshockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F1-coming-soon","Control Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F39.1-coming-soon",{"path":369,"title":370,"stem":371},"\u002Fshockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F1-coming-soon","Motion Profiles — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F40.1-coming-soon",{"path":373,"title":374,"stem":375},"\u002Fshockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F1-coming-soon","Hardware Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F41.1-coming-soon",{"path":377,"title":378,"stem":379},"\u002Fshockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F1-coming-soon","PhotonVision — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F42.1-coming-soon",{"path":381,"title":382,"stem":383},"\u002Fshockwave-curriculum\u002Flessons\u002Fch43-apriltags-and-pose\u002F1-coming-soon","AprilTags & Pose — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch43-apriltags-and-pose\u002F43.1-coming-soon",{"path":385,"title":386,"stem":387},"\u002Fshockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F1-coming-soon","Subsystems I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F44.1-coming-soon",{"path":389,"title":390,"stem":391},"\u002Fshockwave-curriculum\u002Flessons\u002Fch45-subsystems-ii-advanced\u002F1-coming-soon","Subsystems II — Advanced — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch45-subsystems-ii-advanced\u002F45.1-coming-soon",{"path":393,"title":394,"stem":395},"\u002Fshockwave-curriculum\u002Flessons\u002Fch46-team-utilities-i\u002F1-coming-soon","Team Utilities I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch46-team-utilities-i\u002F46.1-coming-soon",{"path":397,"title":398,"stem":399},"\u002Fshockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F1-coming-soon","Field Constants — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F47.1-coming-soon",{"path":401,"title":402,"stem":403},"\u002Fshockwave-curriculum\u002Flessons\u002Fch48-troubleshooting-i-runtime-debug\u002F1-coming-soon","Troubleshooting I — Runtime Debug — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch48-troubleshooting-i-runtime-debug\u002F48.1-coming-soon",{"path":405,"title":406,"stem":407},"\u002Fshockwave-curriculum\u002Flessons\u002Fch49-troubleshooting-ii-can-and-sim\u002F1-coming-soon","Troubleshooting II: CAN & Sim — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch49-troubleshooting-ii-can-and-sim\u002F49.1-coming-soon",{"path":409,"title":410,"stem":411},"\u002Fshockwave-curriculum\u002Flessons\u002Fch50-vendor-libraries-talonfx\u002F1-coming-soon","Vendor Libraries: TalonFX — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch50-vendor-libraries-talonfx\u002F50.1-coming-soon",{"path":413,"title":414,"stem":415},"\u002Fshockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F1-coming-soon","Robot Alerts — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F51.1-coming-soon",{"path":417,"title":418,"stem":419},"\u002Fshockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F1-coming-soon","WPILib Commands — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F52.1-coming-soon",{"path":421,"title":422,"stem":423},"\u002Fshockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F1-coming-soon","WPILib Geometry — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F53.1-coming-soon",{"path":425,"title":426,"stem":427},"\u002Fshockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F1-coming-soon","NetworkTables — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F54.1-coming-soon",{"path":429,"title":430,"stem":431},"\u002Fshockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F1-coming-soon","Command Scheduler — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F55.1-coming-soon",{"path":433,"title":434,"stem":435},"\u002Fshockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F1-coming-soon","WPILib Timers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F56.1-coming-soon",{"path":437,"title":438,"stem":439},"\u002Fshockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F1-coming-soon","WPILib Triggers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F57.1-coming-soon",{"path":441,"title":442,"stem":443},"\u002Fshockwave-curriculum\u002Flessons\u002Fch58-vendor-units-and-conversions\u002F1-coming-soon","Vendor Units & Conversions — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch58-vendor-units-and-conversions\u002F58.1-coming-soon",[445,449,453,457,461,465,469,473,477,481,485,489,493,497,501,505,509,513,517,521,525,529,533,537,541,545,549,553,557,561,565,569,573,577,581,585,589,593,597,601,605,609,613,617,621,625,629,633,637,641,645,649,653,657,661,665,669,673,677,681,685,689,693,697,701,705,709,713,717,721,725,729,733,737,741,745,749],{"path":446,"title":447,"stem":448},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":450,"title":451,"stem":452},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":454,"title":455,"stem":456},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":458,"title":459,"stem":460},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":462,"title":463,"stem":464},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":466,"title":467,"stem":468},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":470,"title":471,"stem":472},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":474,"title":475,"stem":476},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":478,"title":479,"stem":480},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":482,"title":483,"stem":484},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":486,"title":487,"stem":488},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":490,"title":491,"stem":492},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":494,"title":495,"stem":496},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":498,"title":499,"stem":500},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":502,"title":503,"stem":504},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":506,"title":507,"stem":508},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","if Statements & For Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":510,"title":511,"stem":512},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":514,"title":515,"stem":516},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":518,"title":519,"stem":520},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":522,"title":523,"stem":524},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":526,"title":527,"stem":528},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":530,"title":531,"stem":532},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":534,"title":535,"stem":536},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":538,"title":539,"stem":540},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws) — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":542,"title":543,"stem":544},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F8-while-loops","While Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.8-while-loops",{"path":546,"title":547,"stem":548},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":550,"title":551,"stem":552},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F1-strings","Strings — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.1-strings",{"path":554,"title":555,"stem":556},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.2-string-algorithms",{"path":558,"title":559,"stem":560},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","Anatomy of a Java Class — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":562,"title":563,"stem":564},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":566,"title":567,"stem":568},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":570,"title":571,"stem":572},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":574,"title":575,"stem":576},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\" — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":578,"title":579,"stem":580},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":582,"title":583,"stem":584},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":586,"title":587,"stem":588},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":590,"title":591,"stem":592},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":594,"title":595,"stem":596},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":598,"title":599,"stem":600},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":602,"title":603,"stem":604},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":606,"title":607,"stem":608},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":610,"title":611,"stem":612},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":614,"title":615,"stem":616},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":618,"title":619,"stem":620},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":622,"title":623,"stem":624},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":626,"title":627,"stem":628},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":630,"title":631,"stem":632},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":634,"title":635,"stem":636},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap) — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":638,"title":639,"stem":640},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":642,"title":643,"stem":644},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":646,"title":647,"stem":648},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":650,"title":651,"stem":652},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":654,"title":655,"stem":656},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":658,"title":659,"stem":660},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":662,"title":663,"stem":664},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":666,"title":667,"stem":668},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":670,"title":671,"stem":672},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":674,"title":675,"stem":676},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":678,"title":679,"stem":680},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":682,"title":683,"stem":684},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":686,"title":687,"stem":688},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch21-static-factories\u002F21-static-factories","Static Factories — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch21-static-factories\u002F21-static-factories",{"path":690,"title":691,"stem":692},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":694,"title":695,"stem":696},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":698,"title":699,"stem":700},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":702,"title":703,"stem":704},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming? — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":706,"title":707,"stem":708},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":710,"title":711,"stem":712},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":714,"title":715,"stem":716},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":718,"title":719,"stem":720},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":722,"title":723,"stem":724},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":726,"title":727,"stem":728},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":730,"title":731,"stem":732},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":734,"title":735,"stem":736},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":738,"title":739,"stem":740},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":742,"title":743,"stem":744},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":746,"title":747,"stem":748},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":750,"title":751,"stem":752},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",[754,758,762,766,770,774,778,782,786,790,794,798,802,806,810,814,818,822,826,830,834,838,842,846,850,854,858,862,866,870,874,878,882,886,890,894,898,902,906,910,914,918,922,926,930,934,938,942,946,950,954,958,962,966,970,974,978,982,986,990,994,998,1002,1006,1010,1014,1018,1022,1026,1030,1034,1038,1042,1046,1050,1054,1058,1062,1066],{"path":755,"title":756,"stem":757},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers — Exercises","shockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":759,"title":760,"stem":761},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":763,"title":764,"stem":765},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":767,"title":768,"stem":769},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":771,"title":772,"stem":773},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":775,"title":776,"stem":777},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":779,"title":780,"stem":781},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":783,"title":784,"stem":785},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":787,"title":788,"stem":789},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":791,"title":792,"stem":793},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":795,"title":796,"stem":797},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":799,"title":800,"stem":801},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":803,"title":804,"stem":805},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":807,"title":808,"stem":809},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":811,"title":812,"stem":813},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":815,"title":816,"stem":817},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","if Statements & For Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":819,"title":820,"stem":821},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":823,"title":824,"stem":825},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":827,"title":828,"stem":829},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":831,"title":832,"stem":833},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":835,"title":836,"stem":837},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":839,"title":840,"stem":841},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":843,"title":844,"stem":845},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":847,"title":848,"stem":849},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws) — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":851,"title":852,"stem":853},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F8-while-loops","While Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.8-while-loops",{"path":855,"title":856,"stem":857},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":859,"title":860,"stem":861},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F1-strings","Strings — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.1-strings",{"path":863,"title":864,"stem":865},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.2-string-algorithms",{"path":867,"title":868,"stem":869},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","Anatomy of a Java Class — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":871,"title":872,"stem":873},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":875,"title":876,"stem":877},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":879,"title":880,"stem":881},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":883,"title":884,"stem":885},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\" — Exercises","shockwave-curriculum\u002Fexercises\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":887,"title":888,"stem":889},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":891,"title":892,"stem":893},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":895,"title":896,"stem":897},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":899,"title":900,"stem":901},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":903,"title":904,"stem":905},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":907,"title":908,"stem":909},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":911,"title":912,"stem":913},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":915,"title":916,"stem":917},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":919,"title":920,"stem":921},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":923,"title":924,"stem":925},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":927,"title":928,"stem":929},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":931,"title":932,"stem":933},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices — Exercises","shockwave-curriculum\u002Fexercises\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":935,"title":936,"stem":937},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch — Exercises","shockwave-curriculum\u002Fexercises\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":939,"title":940,"stem":941},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas — Exercises","shockwave-curriculum\u002Fexercises\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":943,"title":944,"stem":945},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch14-why-design-patterns\u002F14-why-design-patterns","Why Design Patterns? — Exercises","shockwave-curriculum\u002Fexercises\u002Fch14-why-design-patterns\u002F14-why-design-patterns",{"path":947,"title":948,"stem":949},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap) — Exercises","shockwave-curriculum\u002Fexercises\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":951,"title":952,"stem":953},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics — Exercises","shockwave-curriculum\u002Fexercises\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":955,"title":956,"stem":957},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":959,"title":960,"stem":961},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":963,"title":964,"stem":965},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":967,"title":968,"stem":969},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":971,"title":972,"stem":973},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":975,"title":976,"stem":977},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":979,"title":980,"stem":981},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":983,"title":984,"stem":985},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":987,"title":988,"stem":989},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts — Exercises","shockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":991,"title":992,"stem":993},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References — Exercises","shockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":995,"title":996,"stem":997},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern — Exercises","shockwave-curriculum\u002Fexercises\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":999,"title":1000,"stem":1001},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch21-static-factories\u002F21-static-factories","Static Factories — Exercises","shockwave-curriculum\u002Fexercises\u002Fch21-static-factories\u002F21-static-factories",{"path":1003,"title":1004,"stem":1005},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern — Exercises","shockwave-curriculum\u002Fexercises\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":1007,"title":1008,"stem":1009},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability — Exercises","shockwave-curriculum\u002Fexercises\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":1011,"title":1012,"stem":1013},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":1015,"title":1016,"stem":1017},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming? — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":1019,"title":1020,"stem":1021},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":1023,"title":1024,"stem":1025},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":1027,"title":1028,"stem":1029},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":1031,"title":1032,"stem":1033},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":1035,"title":1036,"stem":1037},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":1039,"title":1040,"stem":1041},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":1043,"title":1044,"stem":1045},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways — Exercises","shockwave-curriculum\u002Fexercises\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":1047,"title":1048,"stem":1049},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design — Exercises","shockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":1051,"title":1052,"stem":1053},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F2-impact-of-program-design","Impact of Program Design — Exercises","shockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F27.2-impact-of-program-design",{"path":1055,"title":1056,"stem":1057},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":1059,"title":1060,"stem":1061},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":1063,"title":1064,"stem":1065},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":1067,"title":1068,"stem":1069},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",{"id":1071,"title":222,"body":1072,"description":1164,"extension":1918,"meta":1919,"navigation":1192,"path":221,"seo":1922,"stem":223,"__hash__":1923},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass.md",{"type":1073,"value":1074,"toc":1907},"minimark",[1075,1079,1084,1119,1134,1138,1158,1212,1226,1291,1295,1311,1315,1377,1381,1433,1439,1482,1501,1537,1541,1577,1602,1614,1641,1664,1668,1733,1737,1817,1821,1893,1903],[1076,1077,222],"h1",{"id":1078},"object-superclass",[1080,1081,1083],"h2",{"id":1082},"every-classs-ultimate-parent","Every Class's Ultimate Parent",[1085,1086,1087,1091,1092,1095,1096,1099,1100,1102,1103,1106,1107,1110,1111,1114,1115,1118],"p",{},[1088,1089,1090],"code",{},"Object"," (from ",[1088,1093,1094],{},"java.lang",") is the superclass of every class in Java — any class without an explicit ",[1088,1097,1098],{},"extends"," inherits from it automatically. Three of ",[1088,1101,1090],{},"'s methods matter enough to override in almost every class you write: ",[1088,1104,1105],{},"toString()",", ",[1088,1108,1109],{},"equals(Object other)",", and — always together with ",[1088,1112,1113],{},"equals"," — ",[1088,1116,1117],{},"hashCode()",".",[1085,1120,1121,1122,1126,1127,1130,1131,1133],{},"This lesson replaces inherited methods with new versions, which is called ",[1123,1124,1125],"strong",{},"overriding",", and marks each one with ",[1088,1128,1129],{},"@Override",". Lesson 18.1 covers overriding in full; for now, ",[1088,1132,1129],{}," just tells the compiler \"this method replaces one I inherited,\" and the compiler double-checks that it really does.",[1080,1135,1137],{"id":1136},"overriding-tostring","Overriding toString()",[1085,1139,1140,1142,1143,1145,1146,1149,1150,1153,1154,1157],{},[1088,1141,1090],{},"'s default ",[1088,1144,1105],{}," produces an unhelpful string like ",[1088,1147,1148],{},"RobotPart@1a2b3c"," (the class name, ",[1088,1151,1152],{},"@",", and the object's hash code in hex). Overriding it to describe the object's real state is good practice in nearly every class. Here's what ",[1088,1155,1156],{},"RobotPart"," (Lesson 17.1) adds:",[1159,1160,1165],"pre",{"className":1161,"code":1162,"language":1163,"meta":1164,"style":1164},"language-java shiki shiki-themes github-light github-dark","public class RobotPart\n{\n    \u002F\u002F ...name field, constructor, getName(), log(), and stop() as in Lesson 17.1\n\n    @Override\n    public String toString() { return name; }\n}\n","java","",[1088,1166,1167,1175,1181,1187,1194,1200,1206],{"__ignoreMap":1164},[1168,1169,1172],"span",{"class":1170,"line":1171},"line",1,[1168,1173,1174],{},"public class RobotPart\n",[1168,1176,1178],{"class":1170,"line":1177},2,[1168,1179,1180],{},"{\n",[1168,1182,1184],{"class":1170,"line":1183},3,[1168,1185,1186],{},"    \u002F\u002F ...name field, constructor, getName(), log(), and stop() as in Lesson 17.1\n",[1168,1188,1190],{"class":1170,"line":1189},4,[1168,1191,1193],{"emptyLinePlaceholder":1192},true,"\n",[1168,1195,1197],{"class":1170,"line":1196},5,[1168,1198,1199],{},"    @Override\n",[1168,1201,1203],{"class":1170,"line":1202},6,[1168,1204,1205],{},"    public String toString() { return name; }\n",[1168,1207,1209],{"class":1170,"line":1208},7,[1168,1210,1211],{},"}\n",[1085,1213,1214,1215,1217,1218,1221,1222,1225],{},"A subclass's own ",[1088,1216,1105],{}," can call ",[1088,1219,1220],{},"super.toString()"," — \"the superclass's version of this method\" (Lesson 18.2 covers ",[1088,1223,1224],{},"super.method()"," in full) — and build on it, rather than starting from scratch:",[1159,1227,1229],{"className":1161,"code":1228,"language":1163,"meta":1164,"style":1164},"public class Intake extends RobotPart\n{\n    private boolean hasGamePiece;\n\n    public Intake(String name) { super(name); }\n\n    @Override\n    public String toString()\n    {\n        return super.toString() + \" (hasGamePiece=\" + hasGamePiece + \")\";\n    }\n}\n",[1088,1230,1231,1236,1240,1245,1249,1254,1258,1262,1268,1274,1280,1286],{"__ignoreMap":1164},[1168,1232,1233],{"class":1170,"line":1171},[1168,1234,1235],{},"public class Intake extends RobotPart\n",[1168,1237,1238],{"class":1170,"line":1177},[1168,1239,1180],{},[1168,1241,1242],{"class":1170,"line":1183},[1168,1243,1244],{},"    private boolean hasGamePiece;\n",[1168,1246,1247],{"class":1170,"line":1189},[1168,1248,1193],{"emptyLinePlaceholder":1192},[1168,1250,1251],{"class":1170,"line":1196},[1168,1252,1253],{},"    public Intake(String name) { super(name); }\n",[1168,1255,1256],{"class":1170,"line":1202},[1168,1257,1193],{"emptyLinePlaceholder":1192},[1168,1259,1260],{"class":1170,"line":1208},[1168,1261,1199],{},[1168,1263,1265],{"class":1170,"line":1264},8,[1168,1266,1267],{},"    public String toString()\n",[1168,1269,1271],{"class":1170,"line":1270},9,[1168,1272,1273],{},"    {\n",[1168,1275,1277],{"class":1170,"line":1276},10,[1168,1278,1279],{},"        return super.toString() + \" (hasGamePiece=\" + hasGamePiece + \")\";\n",[1168,1281,1283],{"class":1170,"line":1282},11,[1168,1284,1285],{},"    }\n",[1168,1287,1289],{"class":1170,"line":1288},12,[1168,1290,1211],{},[1080,1292,1294],{"id":1293},"the-equals-method","The equals() Method",[1085,1296,1297,1299,1300,1302,1303,1306,1307,1310],{},[1088,1298,1109],{},", inherited from ",[1088,1301,1090],{},", tests whether two references point to the exact same object — the same result as ",[1088,1304,1305],{},"=="," (the \"== vs. .equals()\" gotcha from Lesson 6.1 and Ch.13 exists precisely because many classes, like ",[1088,1308,1309],{},"String",", override this default with something more useful).",[1080,1312,1314],{"id":1313},"checking-and-casting-object-types","Checking and Casting Object Types",[1085,1316,1317,1318,1320,1321,1323,1324,1327,1328,1331,1332,1335,1336,1338,1339,1342,1343,1327,1345,1348,1349,1352,1353,1356,1357,1359,1360,1362,1363,1365,1366,1368,1369,1372,1373,1376],{},"Overriding ",[1088,1319,1113],{}," needs two tools for working with an ",[1088,1322,1090],{},"-typed parameter. ",[1088,1325,1326],{},"x instanceof RobotPart"," is ",[1088,1329,1330],{},"true"," when the object ",[1088,1333,1334],{},"x"," refers to is a ",[1088,1337,1156],{}," or any subclass of one (and ",[1088,1340,1341],{},"false"," when ",[1088,1344,1334],{},[1088,1346,1347],{},"null","). A ",[1123,1350,1351],{},"cast"," like ",[1088,1354,1355],{},"(RobotPart) other"," tells the compiler to treat an ",[1088,1358,1090],{}," reference as a ",[1088,1361,1156],{}," reference, so ",[1088,1364,1156],{},"'s fields and methods can be used through it — it doesn't change the object at all. If the object isn't really a ",[1088,1367,1156],{},", the cast throws a ",[1088,1370,1371],{},"ClassCastException",", which is why the ",[1088,1374,1375],{},"instanceof"," check comes first. Lesson 18.3 covers casting between class types in full.",[1080,1378,1380],{"id":1379},"overriding-equals-correctly","Overriding equals() Correctly",[1085,1382,1317,1383,1385,1386,1389,1390,1393,1394,1397,1398,1400,1401,1393,1404,1407,1408,1400,1411,1393,1414,1416,1417,1420,1421,1400,1424,1427,1428,1118],{},[1088,1384,1113],{}," is more involved than ",[1088,1387,1388],{},"toString",", since it has to satisfy five formal requirements to remain safe to use anywhere: ",[1123,1391,1392],{},"reflexive"," (",[1088,1395,1396],{},"o.equals(o)"," is always ",[1088,1399,1330],{},"), ",[1123,1402,1403],{},"symmetric",[1088,1405,1406],{},"a.equals(b)"," matches ",[1088,1409,1410],{},"b.equals(a)",[1123,1412,1413],{},"transitive",[1088,1415,1406],{}," and ",[1088,1418,1419],{},"b.equals(c)"," implies ",[1088,1422,1423],{},"a.equals(c)",[1123,1425,1426],{},"consistent"," (repeated calls give the same answer, if nothing changed), and ",[1123,1429,1430,1431],{},"never equal to ",[1088,1432,1347],{},[1085,1434,1435,1436,1438],{},"A standard recipe, added to ",[1088,1437,1156],{},", satisfies all five:",[1159,1440,1442],{"className":1161,"code":1441,"language":1163,"meta":1164,"style":1164},"@Override\npublic boolean equals(Object other)\n{\n    if (this == other) return true;                   \u002F\u002F 1. quick check: same object\n    if (!(other instanceof RobotPart)) return false;  \u002F\u002F 2. must be the same type\n    RobotPart o = (RobotPart) other;                  \u002F\u002F 3. safe to cast now\n    return this.name.equals(o.name);                  \u002F\u002F 4. compare the relevant fields\n}\n",[1088,1443,1444,1449,1454,1458,1463,1468,1473,1478],{"__ignoreMap":1164},[1168,1445,1446],{"class":1170,"line":1171},[1168,1447,1448],{},"@Override\n",[1168,1450,1451],{"class":1170,"line":1177},[1168,1452,1453],{},"public boolean equals(Object other)\n",[1168,1455,1456],{"class":1170,"line":1183},[1168,1457,1180],{},[1168,1459,1460],{"class":1170,"line":1189},[1168,1461,1462],{},"    if (this == other) return true;                   \u002F\u002F 1. quick check: same object\n",[1168,1464,1465],{"class":1170,"line":1196},[1168,1466,1467],{},"    if (!(other instanceof RobotPart)) return false;  \u002F\u002F 2. must be the same type\n",[1168,1469,1470],{"class":1170,"line":1202},[1168,1471,1472],{},"    RobotPart o = (RobotPart) other;                  \u002F\u002F 3. safe to cast now\n",[1168,1474,1475],{"class":1170,"line":1208},[1168,1476,1477],{},"    return this.name.equals(o.name);                  \u002F\u002F 4. compare the relevant fields\n",[1168,1479,1480],{"class":1170,"line":1264},[1168,1481,1211],{},[1085,1483,1484,1485,1489,1490,1493,1494,1497,1498,1500],{},"Since Java 16, steps 2 and 3 can be combined into one line with a ",[1486,1487,1488],"em",{},"pattern",": ",[1088,1491,1492],{},"if (!(other instanceof RobotPart o)) return false;"," checks the type and, when the check passes, gives you ",[1088,1495,1496],{},"o"," already cast to ",[1088,1499,1156],{},". Both versions do exactly the same thing.",[1085,1502,1503,1504,1506,1507,1510,1511,1513,1514,1106,1517,1106,1520,1523,1524,1527,1528,1530,1531,1533,1534,1536],{},"Note the parameter type is always ",[1088,1505,1090],{},", never the class itself. ",[1088,1508,1509],{},"equals(RobotPart other)"," would be a completely different method (overloading, not overriding): it runs only when the argument's declared type is ",[1088,1512,1156],{},". Library code — ",[1088,1515,1516],{},"ArrayList.contains",[1088,1518,1519],{},"HashMap",[1088,1521,1522],{},"HashSet"," — always calls ",[1088,1525,1526],{},"equals(Object)",", which would still be ",[1088,1529,1090],{},"'s identity check. The bug stays silent until a collection gives a wrong answer, and ",[1088,1532,1129],{}," is what catches it: on ",[1088,1535,1509],{}," it's a compile error.",[1080,1538,1540],{"id":1539},"equals-and-hashcode-go-together","equals() and hashCode() Go Together",[1085,1542,1543,1545,1546,1489,1548,1550,1551,1554,1555,1416,1557,1559,1560,1568,1569,1142,1571,1573,1574,1576],{},[1088,1544,1090],{}," has a third method tied to ",[1088,1547,1113],{},[1088,1549,1117],{},", which returns an ",[1088,1552,1553],{},"int"," that ",[1088,1556,1519],{},[1088,1558,1522],{}," (Ch.9, Ch.15) use to decide where to store and look for an object. The rule: ",[1123,1561,1562,1563,1565,1566],{},"two objects that are ",[1088,1564,1113],{}," must return the same ",[1088,1567,1117],{},". ",[1088,1570,1090],{},[1088,1572,1117],{}," gives every separate object its own value, so a class that overrides only ",[1088,1575,1113],{}," breaks hash-based collections:",[1159,1578,1580],{"className":1161,"code":1579,"language":1163,"meta":1164,"style":1164},"HashSet\u003CRobotPart> parts = new HashSet\u003CRobotPart>();\nparts.add(new RobotPart(\"Front Intake\"));\n\u002F\u002F false without a hashCode() override, even though equals() says they match\nSystem.out.println(parts.contains(new RobotPart(\"Front Intake\")));\n",[1088,1581,1582,1587,1592,1597],{"__ignoreMap":1164},[1168,1583,1584],{"class":1170,"line":1171},[1168,1585,1586],{},"HashSet\u003CRobotPart> parts = new HashSet\u003CRobotPart>();\n",[1168,1588,1589],{"class":1170,"line":1177},[1168,1590,1591],{},"parts.add(new RobotPart(\"Front Intake\"));\n",[1168,1593,1594],{"class":1170,"line":1183},[1168,1595,1596],{},"\u002F\u002F false without a hashCode() override, even though equals() says they match\n",[1168,1598,1599],{"class":1170,"line":1189},[1168,1600,1601],{},"System.out.println(parts.contains(new RobotPart(\"Front Intake\")));\n",[1085,1603,1604,1605,1607,1608,1610,1611,1613],{},"The fix is to override ",[1088,1606,1117],{}," whenever you override ",[1088,1609,1113],{},", built from the same fields ",[1088,1612,1113],{}," compares:",[1159,1615,1617],{"className":1161,"code":1616,"language":1163,"meta":1164,"style":1164},"@Override\npublic int hashCode()\n{\n    return name.hashCode();  \u002F\u002F same name -> same hash code\n}\n",[1088,1618,1619,1623,1628,1632,1637],{"__ignoreMap":1164},[1168,1620,1621],{"class":1170,"line":1171},[1168,1622,1448],{},[1168,1624,1625],{"class":1170,"line":1177},[1168,1626,1627],{},"public int hashCode()\n",[1168,1629,1630],{"class":1170,"line":1183},[1168,1631,1180],{},[1168,1633,1634],{"class":1170,"line":1189},[1168,1635,1636],{},"    return name.hashCode();  \u002F\u002F same name -> same hash code\n",[1168,1638,1639],{"class":1170,"line":1196},[1168,1640,1211],{},[1085,1642,1643,1644,1646,1647,1650,1651,1653,1654,1656,1657,1091,1660,1663],{},"With that added to ",[1088,1645,1156],{},", the ",[1088,1648,1649],{},"contains"," call above prints ",[1088,1652,1330],{},". For a class whose ",[1088,1655,1113],{}," compares several fields, ",[1088,1658,1659],{},"return Objects.hash(field1, field2);",[1088,1661,1662],{},"java.util.Objects",") combines them.",[1080,1665,1667],{"id":1666},"the-subclass-equals-trap","The Subclass equals() Trap",[1085,1669,1317,1670,1672,1673,1676,1677,1680,1681,1683,1684,1686,1687,1690,1691,1694,1695,1698,1699,1701,1702,1704,1705,1708,1709,1698,1712,1701,1714,1716,1717,1720,1721,1723,1724,1726,1727,1729,1730,1732],{},[1088,1671,1113],{}," again in a subclass of a class that's already overridden it is genuinely difficult to get right, and easy to accidentally break ",[1123,1674,1675],{},"symmetry",". If ",[1088,1678,1679],{},"Intake"," (subclass of ",[1088,1682,1156],{},") overrode ",[1088,1685,1113],{}," to ",[1486,1688,1689],{},"also"," compare ",[1088,1692,1693],{},"hasGamePiece",", then ",[1088,1696,1697],{},"genericPart.equals(intakeObj)"," would call ",[1088,1700,1156],{},"'s ",[1088,1703,1113],{}," (comparing only ",[1088,1706,1707],{},"name","), while ",[1088,1710,1711],{},"intakeObj.equals(genericPart)",[1088,1713,1679],{},[1088,1715,1113],{}," — which checks ",[1088,1718,1719],{},"other instanceof Intake"," and returns ",[1088,1722,1341],{},", since a plain ",[1088,1725,1156],{}," isn't an ",[1088,1728,1679],{},". The two calls disagree, breaking the symmetry rule. The general guideline: only one class in a hierarchy should provide a real ",[1088,1731,1113],{}," override.",[1080,1734,1736],{"id":1735},"common-pitfalls","Common Pitfalls",[1738,1739,1740,1770,1788,1807],"ul",{},[1741,1742,1743,1751,1752,1754,1755,1757,1758,1416,1761,1763,1764,1766,1767,1769],"li",{},[1123,1744,1745,1746,1748,1749,1118],{},"Writing ",[1088,1747,1509],{}," instead of ",[1088,1750,1109],{}," That's overloading a new method, not overriding ",[1088,1753,1090],{},"'s — it only runs for ",[1088,1756,1156],{},"-typed arguments, while collections like ",[1088,1759,1760],{},"ArrayList",[1088,1762,1522],{}," still call ",[1088,1765,1090],{},"'s original identity check. ",[1088,1768,1129],{}," turns this mistake into a compile error.",[1741,1771,1772,1780,1781,1416,1784,1787],{},[1123,1773,1317,1774,1776,1777,1118],{},[1088,1775,1113],{}," without ",[1088,1778,1779],{},"hashCode"," Two equal objects then usually have different hash codes, so ",[1088,1782,1783],{},"HashSet.contains",[1088,1785,1786],{},"HashMap.get"," quietly fail to find them. Override both, using the same fields.",[1741,1789,1790,1796,1797,1800,1801,1803,1804,1806],{},[1123,1791,1792,1793,1795],{},"Forgetting the ",[1088,1794,1375],{}," check before casting."," Casting ",[1088,1798,1799],{},"other"," to your class without checking first throws ",[1088,1802,1371],{}," if ",[1088,1805,1799],{}," turns out to be some unrelated type.",[1741,1808,1809,1814,1815,1732],{},[1123,1810,1317,1811,1813],{},[1088,1812,1113],{}," again further down an inheritance hierarchy."," This tends to violate symmetry — safest to let only one class in the hierarchy own the ",[1088,1816,1113],{},[1080,1818,1820],{"id":1819},"key-takeaways","Key Takeaways",[1738,1822,1823,1836,1844,1859,1878,1887],{},[1741,1824,1825,1827,1828,1106,1830,1832,1833,1835],{},[1088,1826,1090],{}," is the superclass of every class in Java; ",[1088,1829,1105],{},[1088,1831,1109],{},", and ",[1088,1834,1117],{}," are its methods worth overriding almost everywhere.",[1741,1837,1838,1839,1217,1841,1843],{},"A subclass's ",[1088,1840,1105],{},[1088,1842,1220],{}," and extend it, rather than rebuilding the whole description from scratch.",[1741,1845,1846,1142,1848,1850,1851,1853,1854,1856,1857,1118],{},[1088,1847,1090],{},[1088,1849,1113],{}," is identity comparison (same as ",[1088,1852,1305],{},"); a correct override must be reflexive, symmetric, transitive, consistent, and never ",[1088,1855,1330],{}," against ",[1088,1858,1347],{},[1741,1860,1861,1862,1864,1865,1868,1869,1871,1872,1875,1876,1118],{},"The standard ",[1088,1863,1113],{}," recipe: check ",[1088,1866,1867],{},"this == other",", check ",[1088,1870,1375],{},", cast (or use the ",[1088,1873,1874],{},"instanceof RobotPart o"," pattern), then compare the relevant fields — always with parameter type ",[1088,1877,1090],{},[1741,1879,1880,1881,1883,1884,1886],{},"Whenever you override ",[1088,1882,1113],{},", override ",[1088,1885,1779],{}," from the same fields — equal objects must have equal hash codes.",[1741,1888,1889,1890,1892],{},"Avoid overriding ",[1088,1891,1113],{}," more than once down an inheritance hierarchy — it tends to break symmetry.",[1085,1894,1895,1896,1489,1899,1902],{},"Derived from ",[1088,1897,1898],{},"csawesome-2026",[1088,1900,1901],{},"unit-5-inheritance-optional\u002F5.07-object-superclass.md"," (CSA 5.7)",[1904,1905,1906],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":1164,"searchDepth":1177,"depth":1177,"links":1908},[1909,1910,1911,1912,1913,1914,1915,1916,1917],{"id":1082,"depth":1177,"text":1083},{"id":1136,"depth":1177,"text":1137},{"id":1293,"depth":1177,"text":1294},{"id":1313,"depth":1177,"text":1314},{"id":1379,"depth":1177,"text":1380},{"id":1539,"depth":1177,"text":1540},{"id":1666,"depth":1177,"text":1667},{"id":1735,"depth":1177,"text":1736},{"id":1819,"depth":1177,"text":1820},"md",{"outlineRef":1920,"status":1921},"17.4 — Object Superclass (CSA 5.7)","new — authored lesson",{"title":222,"description":1164},"nYX24mRpFUeADsrhmH4BbIopA2MyFCSajwjHn3_lLgM",{"id":1925,"title":655,"body":1926,"description":1164,"extension":1918,"meta":2835,"navigation":1192,"path":654,"seo":2838,"stem":656,"__hash__":2839},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass.md",{"type":1073,"value":1927,"toc":2821},[1928,1931,1935,1950,1957,1977,2050,2059,2065,2084,2160,2173,2181,2198,2239,2282,2291,2312,2338,2346,2350,2670,2674,2682,2748,2752,2819],[1076,1929,655],{"id":1930},"object-superclass-worked-example",[1080,1932,1934],{"id":1933},"problem","Problem",[1085,1936,1937,1938,1941,1942,1945,1946,1949],{},"The pit crew tracks robot batteries by their label, like ",[1088,1939,1940],{},"\"B07\"",". The pit log uses a basic ",[1088,1943,1944],{},"Battery"," object, and the match-readiness check uses a ",[1088,1947,1948],{},"CompetitionBattery",", which also records the battery's resting voltage. Make both print a useful description, with the subclass building on the superclass's description instead of repeating it. Two objects should count as equal when they have the same label, since that means they describe the same physical battery.",[1080,1951,1953,1954,1956],{"id":1952},"step-1-override-tostring-in-the-superclass","Step 1: Override ",[1088,1955,1105],{}," in the Superclass",[1085,1958,1959,1961,1962,1964,1965,1967,1968,1701,1970,1972,1973,1976],{},[1088,1960,1944],{}," has no ",[1088,1963,1098],{},", so its superclass is ",[1088,1966,1090],{},", and it inherits ",[1088,1969,1090],{},[1088,1971,1105],{},". That default prints something like ",[1088,1974,1975],{},"Battery@5ca881b5",", which is no use to the pit crew. Override it:",[1159,1978,1980],{"className":1161,"code":1979,"language":1163,"meta":1164,"style":1164},"class Battery\n{\n    private String label;\n\n    public Battery(String label)\n    {\n        this.label = label;\n    }\n\n    @Override\n    public String toString()\n    {\n        return \"Battery \" + label;\n    }\n}\n",[1088,1981,1982,1987,1991,1996,2000,2005,2009,2014,2018,2022,2026,2030,2034,2040,2045],{"__ignoreMap":1164},[1168,1983,1984],{"class":1170,"line":1171},[1168,1985,1986],{},"class Battery\n",[1168,1988,1989],{"class":1170,"line":1177},[1168,1990,1180],{},[1168,1992,1993],{"class":1170,"line":1183},[1168,1994,1995],{},"    private String label;\n",[1168,1997,1998],{"class":1170,"line":1189},[1168,1999,1193],{"emptyLinePlaceholder":1192},[1168,2001,2002],{"class":1170,"line":1196},[1168,2003,2004],{},"    public Battery(String label)\n",[1168,2006,2007],{"class":1170,"line":1202},[1168,2008,1273],{},[1168,2010,2011],{"class":1170,"line":1208},[1168,2012,2013],{},"        this.label = label;\n",[1168,2015,2016],{"class":1170,"line":1264},[1168,2017,1285],{},[1168,2019,2020],{"class":1170,"line":1270},[1168,2021,1193],{"emptyLinePlaceholder":1192},[1168,2023,2024],{"class":1170,"line":1276},[1168,2025,1199],{},[1168,2027,2028],{"class":1170,"line":1282},[1168,2029,1267],{},[1168,2031,2032],{"class":1170,"line":1288},[1168,2033,1273],{},[1168,2035,2037],{"class":1170,"line":2036},13,[1168,2038,2039],{},"        return \"Battery \" + label;\n",[1168,2041,2043],{"class":1170,"line":2042},14,[1168,2044,1285],{},[1168,2046,2048],{"class":1170,"line":2047},15,[1168,2049,1211],{},[1085,2051,2052,2054,2055,2058],{},[1088,2053,1129],{}," tells the compiler \"this is meant to replace a method I inherited.\" If the signature were misspelled (say, ",[1088,2056,2057],{},"tostring()","), the compiler would report an error instead of silently adding a new, unused method.",[1080,2060,2062,2063],{"id":2061},"step-2-build-on-it-in-the-subclass-with-supertostring","Step 2: Build on It in the Subclass with ",[1088,2064,1220],{},[1085,2066,2067,2069,2070,2073,2074,2077,2078,2080,2081,2083],{},[1088,2068,1948],{}," wants the same ",[1088,2071,2072],{},"\"Battery B07\""," text plus its voltage. Instead of rebuilding the label text (which it couldn't do anyway, since ",[1088,2075,2076],{},"label"," is private to ",[1088,2079,1944],{},"), it calls ",[1088,2082,1220],{}," and adds to the result:",[1159,2085,2087],{"className":1161,"code":2086,"language":1163,"meta":1164,"style":1164},"class CompetitionBattery extends Battery\n{\n    private double restingVolts;\n\n    public CompetitionBattery(String label, double restingVolts)\n    {\n        super(label);\n        this.restingVolts = restingVolts;\n    }\n\n    @Override\n    public String toString()\n    {\n        return super.toString() + \" (\" + restingVolts + \"V at rest)\";\n    }\n}\n",[1088,2088,2089,2094,2098,2103,2107,2112,2116,2121,2126,2130,2134,2138,2142,2146,2151,2155],{"__ignoreMap":1164},[1168,2090,2091],{"class":1170,"line":1171},[1168,2092,2093],{},"class CompetitionBattery extends Battery\n",[1168,2095,2096],{"class":1170,"line":1177},[1168,2097,1180],{},[1168,2099,2100],{"class":1170,"line":1183},[1168,2101,2102],{},"    private double restingVolts;\n",[1168,2104,2105],{"class":1170,"line":1189},[1168,2106,1193],{"emptyLinePlaceholder":1192},[1168,2108,2109],{"class":1170,"line":1196},[1168,2110,2111],{},"    public CompetitionBattery(String label, double restingVolts)\n",[1168,2113,2114],{"class":1170,"line":1202},[1168,2115,1273],{},[1168,2117,2118],{"class":1170,"line":1208},[1168,2119,2120],{},"        super(label);\n",[1168,2122,2123],{"class":1170,"line":1264},[1168,2124,2125],{},"        this.restingVolts = restingVolts;\n",[1168,2127,2128],{"class":1170,"line":1270},[1168,2129,1285],{},[1168,2131,2132],{"class":1170,"line":1276},[1168,2133,1193],{"emptyLinePlaceholder":1192},[1168,2135,2136],{"class":1170,"line":1282},[1168,2137,1199],{},[1168,2139,2140],{"class":1170,"line":1288},[1168,2141,1267],{},[1168,2143,2144],{"class":1170,"line":2036},[1168,2145,1273],{},[1168,2147,2148],{"class":1170,"line":2042},[1168,2149,2150],{},"        return super.toString() + \" (\" + restingVolts + \"V at rest)\";\n",[1168,2152,2153],{"class":1170,"line":2047},[1168,2154,1285],{},[1168,2156,2158],{"class":1170,"line":2157},16,[1168,2159,1211],{},[1085,2161,2162,2164,2165,2167,2168,1568,2170,2172],{},[1088,2163,1220],{}," runs ",[1088,2166,1944],{},"'s version, which returns ",[1088,2169,2072],{},[1088,2171,1948],{},"'s version then appends the voltage.",[1080,2174,2176,2177,2180],{"id":2175},"step-3-override-equals-once-in-the-superclass","Step 3: Override ",[1088,2178,2179],{},"equals()"," Once, in the Superclass",[1085,2182,2183,2184,1327,2186,2188,2189,2191,2192,2194,2195,2197],{},"Without an override, ",[1088,2185,1113],{},[1088,2187,1090],{},"'s version: it only returns ",[1088,2190,1330],{}," for the exact same object, just like ",[1088,2193,1305],{},". Add the lesson's four-step recipe to ",[1088,2196,1944],{},", comparing labels:",[1159,2199,2201],{"className":1161,"code":2200,"language":1163,"meta":1164,"style":1164},"@Override\npublic boolean equals(Object other)\n{\n    if (this == other) return true;                \u002F\u002F 1. same object\n    if (!(other instanceof Battery)) return false; \u002F\u002F 2. must be a Battery\n    Battery o = (Battery) other;                   \u002F\u002F 3. safe to cast now\n    return this.label.equals(o.label);             \u002F\u002F 4. compare labels\n}\n",[1088,2202,2203,2207,2211,2215,2220,2225,2230,2235],{"__ignoreMap":1164},[1168,2204,2205],{"class":1170,"line":1171},[1168,2206,1448],{},[1168,2208,2209],{"class":1170,"line":1177},[1168,2210,1453],{},[1168,2212,2213],{"class":1170,"line":1183},[1168,2214,1180],{},[1168,2216,2217],{"class":1170,"line":1189},[1168,2218,2219],{},"    if (this == other) return true;                \u002F\u002F 1. same object\n",[1168,2221,2222],{"class":1170,"line":1196},[1168,2223,2224],{},"    if (!(other instanceof Battery)) return false; \u002F\u002F 2. must be a Battery\n",[1168,2226,2227],{"class":1170,"line":1202},[1168,2228,2229],{},"    Battery o = (Battery) other;                   \u002F\u002F 3. safe to cast now\n",[1168,2231,2232],{"class":1170,"line":1208},[1168,2233,2234],{},"    return this.label.equals(o.label);             \u002F\u002F 4. compare labels\n",[1168,2236,2237],{"class":1170,"line":1264},[1168,2238,1211],{},[1085,2240,2241,2242,2244,2245,2247,2248,2251,2252,2254,2255,2257,2258,2260,2261,2264,2265,2267,2268,2270,2271,2274,2275,2278,2279,2281],{},"The parameter is ",[1088,2243,1090],{},", matching the method ",[1088,2246,1090],{}," declares, so this overrides it. The labels are compared with ",[1088,2249,2250],{},".equals()",", not ",[1088,2253,1305],{},", because they're ",[1088,2256,1309],{},"s. ",[1088,2259,1948],{}," deliberately does ",[1486,2262,2263],{},"not"," get its own ",[1088,2266,1113],{},": only one class in the hierarchy should own it. A ",[1088,2269,1948],{}," passes the ",[1088,2272,2273],{},"instanceof Battery"," check (it ",[1486,2276,2277],{},"is a"," ",[1088,2280,1944],{},"), so it inherits this same comparison.",[1080,2283,2285,2286,2288,2289],{"id":2284},"step-4-pair-equals-with-hashcode","Step 4: Pair ",[1088,2287,2179],{}," with ",[1088,2290,1117],{},[1085,2292,2293,2295,2296,2298,2299,2302,2303,2306,2307,2309,2310,1613],{},[1088,2294,1113],{}," now says two ",[1088,2297,1944],{}," objects with the same label are equal, so their hash codes must match too, or a ",[1088,2300,2301],{},"HashSet\u003CBattery>"," of the pit's batteries wouldn't find ",[1088,2304,2305],{},"B07"," again (Lesson 17.4). Build ",[1088,2308,1117],{}," from the same field ",[1088,2311,1113],{},[1159,2313,2315],{"className":1161,"code":2314,"language":1163,"meta":1164,"style":1164},"@Override\npublic int hashCode()\n{\n    return label.hashCode(); \u002F\u002F same label -> same hash code\n}\n",[1088,2316,2317,2321,2325,2329,2334],{"__ignoreMap":1164},[1168,2318,2319],{"class":1170,"line":1171},[1168,2320,1448],{},[1168,2322,2323],{"class":1170,"line":1177},[1168,2324,1627],{},[1168,2326,2327],{"class":1170,"line":1183},[1168,2328,1180],{},[1168,2330,2331],{"class":1170,"line":1189},[1168,2332,2333],{},"    return label.hashCode(); \u002F\u002F same label -> same hash code\n",[1168,2335,2336],{"class":1170,"line":1196},[1168,2337,1211],{},[1085,2339,2340,2342,2343,2345],{},[1088,2341,1948],{}," inherits this too, so every battery labeled ",[1088,2344,1940],{}," returns the same hash code.",[1080,2347,2349],{"id":2348},"step-5-put-it-together","Step 5: Put It Together",[1159,2351,2353],{"className":1161,"code":2352,"language":1163,"meta":1164,"style":1164},"public class BatteryDemo\n{\n    public static void main(String[] args)\n    {\n        Battery pitLogEntry = new Battery(\"B07\");\n        CompetitionBattery matchCheck = new CompetitionBattery(\"B07\", 12.9);\n\n        System.out.println(pitLogEntry);\n        System.out.println(matchCheck);\n\n        System.out.println(pitLogEntry == matchCheck);\n        System.out.println(pitLogEntry.equals(matchCheck));\n        System.out.println(matchCheck.equals(pitLogEntry));\n    }\n}\n\nclass Battery\n{\n    private String label;\n\n    public Battery(String label)\n    {\n        this.label = label;\n    }\n\n    @Override\n    public String toString()\n    {\n        return \"Battery \" + label;\n    }\n\n    @Override\n    public boolean equals(Object other)\n    {\n        if (this == other) return true;                \u002F\u002F 1. same object\n        if (!(other instanceof Battery)) return false; \u002F\u002F 2. must be a Battery\n        Battery o = (Battery) other;                   \u002F\u002F 3. safe to cast now\n        return this.label.equals(o.label);             \u002F\u002F 4. compare labels\n    }\n\n    @Override\n    public int hashCode()\n    {\n        return label.hashCode(); \u002F\u002F same label -> same hash code\n    }\n}\n\nclass CompetitionBattery extends Battery\n{\n    private double restingVolts;\n\n    public CompetitionBattery(String label, double restingVolts)\n    {\n        super(label);\n        this.restingVolts = restingVolts;\n    }\n\n    @Override\n    public String toString()\n    {\n        return super.toString() + \" (\" + restingVolts + \"V at rest)\";\n    }\n}\n",[1088,2354,2355,2360,2364,2369,2373,2378,2383,2387,2392,2397,2401,2406,2411,2416,2420,2424,2428,2433,2438,2443,2448,2453,2458,2463,2468,2473,2478,2483,2488,2493,2498,2503,2508,2514,2519,2525,2531,2537,2543,2548,2553,2558,2564,2569,2575,2580,2585,2590,2595,2600,2605,2610,2615,2620,2625,2630,2635,2640,2645,2650,2655,2660,2665],{"__ignoreMap":1164},[1168,2356,2357],{"class":1170,"line":1171},[1168,2358,2359],{},"public class BatteryDemo\n",[1168,2361,2362],{"class":1170,"line":1177},[1168,2363,1180],{},[1168,2365,2366],{"class":1170,"line":1183},[1168,2367,2368],{},"    public static void main(String[] args)\n",[1168,2370,2371],{"class":1170,"line":1189},[1168,2372,1273],{},[1168,2374,2375],{"class":1170,"line":1196},[1168,2376,2377],{},"        Battery pitLogEntry = new Battery(\"B07\");\n",[1168,2379,2380],{"class":1170,"line":1202},[1168,2381,2382],{},"        CompetitionBattery matchCheck = new CompetitionBattery(\"B07\", 12.9);\n",[1168,2384,2385],{"class":1170,"line":1208},[1168,2386,1193],{"emptyLinePlaceholder":1192},[1168,2388,2389],{"class":1170,"line":1264},[1168,2390,2391],{},"        System.out.println(pitLogEntry);\n",[1168,2393,2394],{"class":1170,"line":1270},[1168,2395,2396],{},"        System.out.println(matchCheck);\n",[1168,2398,2399],{"class":1170,"line":1276},[1168,2400,1193],{"emptyLinePlaceholder":1192},[1168,2402,2403],{"class":1170,"line":1282},[1168,2404,2405],{},"        System.out.println(pitLogEntry == matchCheck);\n",[1168,2407,2408],{"class":1170,"line":1288},[1168,2409,2410],{},"        System.out.println(pitLogEntry.equals(matchCheck));\n",[1168,2412,2413],{"class":1170,"line":2036},[1168,2414,2415],{},"        System.out.println(matchCheck.equals(pitLogEntry));\n",[1168,2417,2418],{"class":1170,"line":2042},[1168,2419,1285],{},[1168,2421,2422],{"class":1170,"line":2047},[1168,2423,1211],{},[1168,2425,2426],{"class":1170,"line":2157},[1168,2427,1193],{"emptyLinePlaceholder":1192},[1168,2429,2431],{"class":1170,"line":2430},17,[1168,2432,1986],{},[1168,2434,2436],{"class":1170,"line":2435},18,[1168,2437,1180],{},[1168,2439,2441],{"class":1170,"line":2440},19,[1168,2442,1995],{},[1168,2444,2446],{"class":1170,"line":2445},20,[1168,2447,1193],{"emptyLinePlaceholder":1192},[1168,2449,2451],{"class":1170,"line":2450},21,[1168,2452,2004],{},[1168,2454,2456],{"class":1170,"line":2455},22,[1168,2457,1273],{},[1168,2459,2461],{"class":1170,"line":2460},23,[1168,2462,2013],{},[1168,2464,2466],{"class":1170,"line":2465},24,[1168,2467,1285],{},[1168,2469,2471],{"class":1170,"line":2470},25,[1168,2472,1193],{"emptyLinePlaceholder":1192},[1168,2474,2476],{"class":1170,"line":2475},26,[1168,2477,1199],{},[1168,2479,2481],{"class":1170,"line":2480},27,[1168,2482,1267],{},[1168,2484,2486],{"class":1170,"line":2485},28,[1168,2487,1273],{},[1168,2489,2491],{"class":1170,"line":2490},29,[1168,2492,2039],{},[1168,2494,2496],{"class":1170,"line":2495},30,[1168,2497,1285],{},[1168,2499,2501],{"class":1170,"line":2500},31,[1168,2502,1193],{"emptyLinePlaceholder":1192},[1168,2504,2506],{"class":1170,"line":2505},32,[1168,2507,1199],{},[1168,2509,2511],{"class":1170,"line":2510},33,[1168,2512,2513],{},"    public boolean equals(Object other)\n",[1168,2515,2517],{"class":1170,"line":2516},34,[1168,2518,1273],{},[1168,2520,2522],{"class":1170,"line":2521},35,[1168,2523,2524],{},"        if (this == other) return true;                \u002F\u002F 1. same object\n",[1168,2526,2528],{"class":1170,"line":2527},36,[1168,2529,2530],{},"        if (!(other instanceof Battery)) return false; \u002F\u002F 2. must be a Battery\n",[1168,2532,2534],{"class":1170,"line":2533},37,[1168,2535,2536],{},"        Battery o = (Battery) other;                   \u002F\u002F 3. safe to cast now\n",[1168,2538,2540],{"class":1170,"line":2539},38,[1168,2541,2542],{},"        return this.label.equals(o.label);             \u002F\u002F 4. compare labels\n",[1168,2544,2546],{"class":1170,"line":2545},39,[1168,2547,1285],{},[1168,2549,2551],{"class":1170,"line":2550},40,[1168,2552,1193],{"emptyLinePlaceholder":1192},[1168,2554,2556],{"class":1170,"line":2555},41,[1168,2557,1199],{},[1168,2559,2561],{"class":1170,"line":2560},42,[1168,2562,2563],{},"    public int hashCode()\n",[1168,2565,2567],{"class":1170,"line":2566},43,[1168,2568,1273],{},[1168,2570,2572],{"class":1170,"line":2571},44,[1168,2573,2574],{},"        return label.hashCode(); \u002F\u002F same label -> same hash code\n",[1168,2576,2578],{"class":1170,"line":2577},45,[1168,2579,1285],{},[1168,2581,2583],{"class":1170,"line":2582},46,[1168,2584,1211],{},[1168,2586,2588],{"class":1170,"line":2587},47,[1168,2589,1193],{"emptyLinePlaceholder":1192},[1168,2591,2593],{"class":1170,"line":2592},48,[1168,2594,2093],{},[1168,2596,2598],{"class":1170,"line":2597},49,[1168,2599,1180],{},[1168,2601,2603],{"class":1170,"line":2602},50,[1168,2604,2102],{},[1168,2606,2608],{"class":1170,"line":2607},51,[1168,2609,1193],{"emptyLinePlaceholder":1192},[1168,2611,2613],{"class":1170,"line":2612},52,[1168,2614,2111],{},[1168,2616,2618],{"class":1170,"line":2617},53,[1168,2619,1273],{},[1168,2621,2623],{"class":1170,"line":2622},54,[1168,2624,2120],{},[1168,2626,2628],{"class":1170,"line":2627},55,[1168,2629,2125],{},[1168,2631,2633],{"class":1170,"line":2632},56,[1168,2634,1285],{},[1168,2636,2638],{"class":1170,"line":2637},57,[1168,2639,1193],{"emptyLinePlaceholder":1192},[1168,2641,2643],{"class":1170,"line":2642},58,[1168,2644,1199],{},[1168,2646,2648],{"class":1170,"line":2647},59,[1168,2649,1267],{},[1168,2651,2653],{"class":1170,"line":2652},60,[1168,2654,1273],{},[1168,2656,2658],{"class":1170,"line":2657},61,[1168,2659,2150],{},[1168,2661,2663],{"class":1170,"line":2662},62,[1168,2664,1285],{},[1168,2666,2668],{"class":1170,"line":2667},63,[1168,2669,1211],{},[1080,2671,2673],{"id":2672},"what-it-prints","What It Prints",[1159,2675,2680],{"className":2676,"code":2678,"language":2679},[2677],"language-text","Battery B07\nBattery B07 (12.9V at rest)\nfalse\ntrue\ntrue\n","text",[1088,2681,2678],{"__ignoreMap":1164},[1738,2683,2684,2705,2713],{},[1741,2685,2686,2687,2690,2691,2693,2694,2164,2697,2699,2700,2702,2703,1118],{},"Lines 1-2: ",[1088,2688,2689],{},"println"," calls each object's ",[1088,2692,1105],{}," automatically (Ch.7). ",[1088,2695,2696],{},"matchCheck",[1088,2698,1948],{},"'s version, which reuses ",[1088,2701,1944],{},"'s through ",[1088,2704,1220],{},[1741,2706,2707,2708,1327,2710,2712],{},"Line 3: ",[1088,2709,1305],{},[1088,2711,1341],{},". These are two separate objects, even though they describe the same battery.",[1741,2714,2715,2716,1327,2718,2720,2721,2724,2725,2720,2727,2729,2730,1676,2732,2734,2735,2737,2738,2741,2742,2744,2745,2747],{},"Lines 4-5: ",[1088,2717,1113],{},[1088,2719,1330],{}," in ",[1486,2722,2723],{},"both"," directions, which is the symmetry requirement. Both calls run the one ",[1088,2726,1113],{},[1088,2728,1944],{},", and both objects pass ",[1088,2731,2273],{},[1088,2733,1948],{}," had its own ",[1088,2736,1113],{}," checking ",[1088,2739,2740],{},"instanceof CompetitionBattery",", line 5 would be ",[1088,2743,1341],{}," while line 4 stayed ",[1088,2746,1330],{},". That's the subclass trap from the lesson.",[1080,2749,2751],{"id":2750},"recap","Recap",[1738,2753,2754,2770,2780,2793,2805],{},[1741,2755,2756,2757,1106,2759,1832,2761,2763,2764,2766,2767,2769],{},"Every class inherits ",[1088,2758,1105],{},[1088,2760,1109],{},[1088,2762,1117],{}," from ",[1088,2765,1090],{},"; ",[1088,2768,1944],{}," overrides all three.",[1741,2771,1838,2772,1217,2774,2776,2777,2779],{},[1088,2773,1105],{},[1088,2775,1220],{}," and add to it, as ",[1088,2778,1948],{}," does.",[1741,2781,2782,2783,2785,2786,1868,2788,2790,2791,1118],{},"The ",[1088,2784,1113],{}," recipe is: check ",[1088,2787,1867],{},[1088,2789,1375],{},", cast, then compare fields. The parameter type is always ",[1088,2792,1090],{},[1741,2794,2795,2796,2798,2799,2801,2802,2804],{},"Whenever ",[1088,2797,1113],{}," is overridden, ",[1088,2800,1117],{}," is too, built from the same field (",[1088,2803,2076],{},").",[1741,2806,2807,2808,2810,2811,2813,2814,1416,2816,2818],{},"Only one class in the hierarchy owns ",[1088,2809,1113],{},". Here that's ",[1088,2812,1944],{},", which keeps ",[1088,2815,1406],{},[1088,2817,1410],{}," in agreement.",[1904,2820,1906],{},{"title":1164,"searchDepth":1177,"depth":1177,"links":2822},[2823,2824,2826,2828,2830,2832,2833,2834],{"id":1933,"depth":1177,"text":1934},{"id":1952,"depth":1177,"text":2825},"Step 1: Override toString() in the Superclass",{"id":2061,"depth":1177,"text":2827},"Step 2: Build on It in the Subclass with super.toString()",{"id":2175,"depth":1177,"text":2829},"Step 3: Override equals() Once, in the Superclass",{"id":2284,"depth":1177,"text":2831},"Step 4: Pair equals() with hashCode()",{"id":2348,"depth":1177,"text":2349},{"id":2672,"depth":1177,"text":2673},{"id":2750,"depth":1177,"text":2751},{"outlineRef":1920,"pairsWith":2836,"status":2837},"[`lessons\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass.md`](..\u002F..\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt)",{"title":655,"description":1164},"BGdQw12hwzdpTnxWeiZ3vxlZ6rG-Pz5Uz27D0cDi5eI",{"id":2841,"title":968,"body":2842,"description":1164,"extension":1918,"meta":4255,"navigation":1192,"path":967,"seo":4257,"stem":969,"__hash__":4258},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass.md",{"type":1073,"value":2843,"toc":4250},[2844,2847,2851,2857,2987,2994,2999,3025,3031,3068,3111,3115,3138,3266,3281,3331,3336,3342,3491,3577,3581,3587,3623,3643,3680,3686,3691,3822,3827,3832,3838,3843,3848,3853,3857,3863,3867,3873,3878,3882,3888,3892,3898,3903,3907,3913,3917,3923,3928,3932,3938,3942,3948,3953,4186,4248],[1076,2845,968],{"id":2846},"object-superclass-exercises",[1080,2848,2850],{"id":2849},"multiple-choice","Multiple Choice",[1085,2852,2853,2856],{},[1123,2854,2855],{},"Question:"," Given these two classes:",[1159,2858,2860],{"className":1161,"code":2859,"language":1163,"meta":1164,"style":1164},"class Pump\n{\n    private int port;\n\n    public Pump(int port)\n    {\n        this.port = port;\n    }\n\n    @Override\n    public String toString()\n    {\n        return \"Pump \" + port;\n    }\n}\n\nclass VacuumPump extends Pump\n{\n    public VacuumPump(int port)\n    {\n        super(port);\n    }\n\n    @Override\n    public String toString()\n    {\n        return super.toString() + \" [vacuum]\";\n    }\n}\n",[1088,2861,2862,2867,2871,2876,2880,2885,2889,2894,2898,2902,2906,2910,2914,2919,2923,2927,2931,2936,2940,2945,2949,2954,2958,2962,2966,2970,2974,2979,2983],{"__ignoreMap":1164},[1168,2863,2864],{"class":1170,"line":1171},[1168,2865,2866],{},"class Pump\n",[1168,2868,2869],{"class":1170,"line":1177},[1168,2870,1180],{},[1168,2872,2873],{"class":1170,"line":1183},[1168,2874,2875],{},"    private int port;\n",[1168,2877,2878],{"class":1170,"line":1189},[1168,2879,1193],{"emptyLinePlaceholder":1192},[1168,2881,2882],{"class":1170,"line":1196},[1168,2883,2884],{},"    public Pump(int port)\n",[1168,2886,2887],{"class":1170,"line":1202},[1168,2888,1273],{},[1168,2890,2891],{"class":1170,"line":1208},[1168,2892,2893],{},"        this.port = port;\n",[1168,2895,2896],{"class":1170,"line":1264},[1168,2897,1285],{},[1168,2899,2900],{"class":1170,"line":1270},[1168,2901,1193],{"emptyLinePlaceholder":1192},[1168,2903,2904],{"class":1170,"line":1276},[1168,2905,1199],{},[1168,2907,2908],{"class":1170,"line":1282},[1168,2909,1267],{},[1168,2911,2912],{"class":1170,"line":1288},[1168,2913,1273],{},[1168,2915,2916],{"class":1170,"line":2036},[1168,2917,2918],{},"        return \"Pump \" + port;\n",[1168,2920,2921],{"class":1170,"line":2042},[1168,2922,1285],{},[1168,2924,2925],{"class":1170,"line":2047},[1168,2926,1211],{},[1168,2928,2929],{"class":1170,"line":2157},[1168,2930,1193],{"emptyLinePlaceholder":1192},[1168,2932,2933],{"class":1170,"line":2430},[1168,2934,2935],{},"class VacuumPump extends Pump\n",[1168,2937,2938],{"class":1170,"line":2435},[1168,2939,1180],{},[1168,2941,2942],{"class":1170,"line":2440},[1168,2943,2944],{},"    public VacuumPump(int port)\n",[1168,2946,2947],{"class":1170,"line":2445},[1168,2948,1273],{},[1168,2950,2951],{"class":1170,"line":2450},[1168,2952,2953],{},"        super(port);\n",[1168,2955,2956],{"class":1170,"line":2455},[1168,2957,1285],{},[1168,2959,2960],{"class":1170,"line":2460},[1168,2961,1193],{"emptyLinePlaceholder":1192},[1168,2963,2964],{"class":1170,"line":2465},[1168,2965,1199],{},[1168,2967,2968],{"class":1170,"line":2470},[1168,2969,1267],{},[1168,2971,2972],{"class":1170,"line":2475},[1168,2973,1273],{},[1168,2975,2976],{"class":1170,"line":2480},[1168,2977,2978],{},"        return super.toString() + \" [vacuum]\";\n",[1168,2980,2981],{"class":1170,"line":2485},[1168,2982,1285],{},[1168,2984,2985],{"class":1170,"line":2490},[1168,2986,1211],{},[1085,2988,2989,2990,2993],{},"What does ",[1088,2991,2992],{},"System.out.println(new VacuumPump(2));"," print?",[1085,2995,2996],{},[1123,2997,2998],{},"Options:",[1738,3000,3001,3007,3013,3019],{},[1741,3002,3003,3004],{},"A. ",[1088,3005,3006],{},"Pump 2 [vacuum]",[1741,3008,3009,3010],{},"B. ",[1088,3011,3012],{},"Pump 2",[1741,3014,3015,3016],{},"C. ",[1088,3017,3018],{}," [vacuum]",[1741,3020,3021,3022],{},"D. Something like ",[1088,3023,3024],{},"VacuumPump@3b07d329",[1085,3026,3027,3030],{},[1123,3028,3029],{},"Answer:"," A",[1085,3032,3033,2278,3036,3038,3039,3041,3042,3045,3046,3048,3049,3051,3052,3054,3055,2167,3058,1568,3061,3063,3064,3067],{},[1123,3034,3035],{},"Why:",[1088,3037,2689],{}," calls the object's ",[1088,3040,1105],{}," automatically. The object is a ",[1088,3043,3044],{},"VacuumPump",", so ",[1088,3047,3044],{},"'s own ",[1088,3050,1105],{}," runs. Its first step, ",[1088,3053,1220],{},", runs ",[1088,3056,3057],{},"Pump",[1088,3059,3060],{},"\"Pump 2\"",[1088,3062,3044],{},"'s version then appends ",[1088,3065,3066],{},"\" [vacuum]\""," to that.",[1738,3069,3070,3084,3098],{},[1741,3071,3072,3073,3075,3076,3078,3079,3081,3082,1118],{},"B is wrong — that's what a plain ",[1088,3074,3057],{}," would print. ",[1088,3077,3044],{}," overrides ",[1088,3080,1105],{},", so its own version runs, and that version adds ",[1088,3083,3066],{},[1741,3085,3086,3087,3089,3090,1701,3092,3094,3095,3097],{},"C is wrong — ",[1088,3088,1220],{}," isn't skipped or empty. It calls ",[1088,3091,3057],{},[1088,3093,1105],{},", which returns ",[1088,3096,3060],{},", and that becomes the start of the result.",[1741,3099,3100,3101,1142,3103,3105,3106,1416,3108,3110],{},"D is wrong — that's ",[1088,3102,1090],{},[1088,3104,1105],{},", which only runs when no class in the chain overrides it. Here both ",[1088,3107,3057],{},[1088,3109,3044],{}," do.",[1080,3112,3114],{"id":3113},"micro-parsons","Micro-Parsons",[1085,3116,3117,3120,3121,3124,3125,3128,3129,3131,3132,3134,3135,3137],{},[1123,3118,3119],{},"Problem:"," Two ",[1088,3122,3123],{},"FieldTag"," objects should count as equal when they have the same ",[1088,3126,3127],{},"id",". Given this program, with the ",[1088,3130,1113],{}," method missing (its partner, ",[1088,3133,1117],{},", is already written from the same ",[1088,3136,3127],{}," field, as Lesson 17.4 requires):",[1159,3139,3141],{"className":1161,"code":3140,"language":1163,"meta":1164,"style":1164},"public class TagCheck\n{\n    public static void main(String[] args)\n    {\n        FieldTag seen = new FieldTag(7);\n        FieldTag expected = new FieldTag(7);\n        System.out.println(seen == expected);\n        System.out.println(seen.equals(expected));\n    }\n}\n\nclass FieldTag\n{\n    private int id;\n\n    public FieldTag(int id)\n    {\n        this.id = id;\n    }\n\n    \u002F\u002F equals method goes here\n\n    @Override\n    public int hashCode()\n    {\n        return id;\n    }\n}\n",[1088,3142,3143,3148,3152,3156,3160,3165,3170,3175,3180,3184,3188,3192,3197,3201,3206,3210,3215,3219,3224,3228,3232,3237,3241,3245,3249,3253,3258,3262],{"__ignoreMap":1164},[1168,3144,3145],{"class":1170,"line":1171},[1168,3146,3147],{},"public class TagCheck\n",[1168,3149,3150],{"class":1170,"line":1177},[1168,3151,1180],{},[1168,3153,3154],{"class":1170,"line":1183},[1168,3155,2368],{},[1168,3157,3158],{"class":1170,"line":1189},[1168,3159,1273],{},[1168,3161,3162],{"class":1170,"line":1196},[1168,3163,3164],{},"        FieldTag seen = new FieldTag(7);\n",[1168,3166,3167],{"class":1170,"line":1202},[1168,3168,3169],{},"        FieldTag expected = new FieldTag(7);\n",[1168,3171,3172],{"class":1170,"line":1208},[1168,3173,3174],{},"        System.out.println(seen == expected);\n",[1168,3176,3177],{"class":1170,"line":1264},[1168,3178,3179],{},"        System.out.println(seen.equals(expected));\n",[1168,3181,3182],{"class":1170,"line":1270},[1168,3183,1285],{},[1168,3185,3186],{"class":1170,"line":1276},[1168,3187,1211],{},[1168,3189,3190],{"class":1170,"line":1282},[1168,3191,1193],{"emptyLinePlaceholder":1192},[1168,3193,3194],{"class":1170,"line":1288},[1168,3195,3196],{},"class FieldTag\n",[1168,3198,3199],{"class":1170,"line":2036},[1168,3200,1180],{},[1168,3202,3203],{"class":1170,"line":2042},[1168,3204,3205],{},"    private int id;\n",[1168,3207,3208],{"class":1170,"line":2047},[1168,3209,1193],{"emptyLinePlaceholder":1192},[1168,3211,3212],{"class":1170,"line":2157},[1168,3213,3214],{},"    public FieldTag(int id)\n",[1168,3216,3217],{"class":1170,"line":2430},[1168,3218,1273],{},[1168,3220,3221],{"class":1170,"line":2435},[1168,3222,3223],{},"        this.id = id;\n",[1168,3225,3226],{"class":1170,"line":2440},[1168,3227,1285],{},[1168,3229,3230],{"class":1170,"line":2445},[1168,3231,1193],{"emptyLinePlaceholder":1192},[1168,3233,3234],{"class":1170,"line":2450},[1168,3235,3236],{},"    \u002F\u002F equals method goes here\n",[1168,3238,3239],{"class":1170,"line":2455},[1168,3240,1193],{"emptyLinePlaceholder":1192},[1168,3242,3243],{"class":1170,"line":2460},[1168,3244,1199],{},[1168,3246,3247],{"class":1170,"line":2465},[1168,3248,2563],{},[1168,3250,3251],{"class":1170,"line":2470},[1168,3252,1273],{},[1168,3254,3255],{"class":1170,"line":2475},[1168,3256,3257],{},"        return id;\n",[1168,3259,3260],{"class":1170,"line":2480},[1168,3261,1285],{},[1168,3263,3264],{"class":1170,"line":2485},[1168,3265,1211],{},[1085,3267,3268,3269,3271,3272,3274,3275,3277,3278,3280],{},"Reorder the fragments below into the ",[1088,3270,1113],{}," method, following the standard recipe (same-object check, ",[1088,3273,1375],{}," check, cast, compare fields), so the program prints ",[1088,3276,1341],{}," and then ",[1088,3279,1330],{},":",[1738,3282,3283,3289,3295,3301,3307,3313,3319,3325],{},[1741,3284,3285,3286],{},"a. ",[1088,3287,3288],{},"        FieldTag o = (FieldTag) other;",[1741,3290,3291,3292],{},"b. ",[1088,3293,3294],{},"    public boolean equals(Object other)",[1741,3296,3297,3298],{},"c. ",[1088,3299,3300],{},"    }",[1741,3302,3303,3304],{},"d. ",[1088,3305,3306],{},"        if (this == other) return true;",[1741,3308,3309,3310],{},"e. ",[1088,3311,3312],{},"        return this.id == o.id;",[1741,3314,3315,3316],{},"f. ",[1088,3317,3318],{},"    @Override",[1741,3320,3321,3322],{},"g. ",[1088,3323,3324],{},"        if (!(other instanceof FieldTag)) return false;",[1741,3326,3327,3328],{},"h. ",[1088,3329,3330],{},"    {",[1085,3332,3333,3335],{},[1123,3334,3029],{}," f, b, h, d, g, a, e, c",[1085,3337,3338,3341],{},[1123,3339,3340],{},"Interchangeable:"," (d, g)",[1159,3343,3345],{"className":1161,"code":3344,"language":1163,"meta":1164,"style":1164},"public class TagCheck\n{\n    public static void main(String[] args)\n    {\n        FieldTag seen = new FieldTag(7);\n        FieldTag expected = new FieldTag(7);\n        System.out.println(seen == expected);\n        System.out.println(seen.equals(expected));\n    }\n}\n\nclass FieldTag\n{\n    private int id;\n\n    public FieldTag(int id)\n    {\n        this.id = id;\n    }\n\n    @Override\n    public boolean equals(Object other)\n    {\n        if (this == other) return true;\n        if (!(other instanceof FieldTag)) return false;\n        FieldTag o = (FieldTag) other;\n        return this.id == o.id;\n    }\n\n    @Override\n    public int hashCode()\n    {\n        return id;\n    }\n}\n",[1088,3346,3347,3351,3355,3359,3363,3367,3371,3375,3379,3383,3387,3391,3395,3399,3403,3407,3411,3415,3419,3423,3427,3431,3435,3439,3444,3449,3454,3459,3463,3467,3471,3475,3479,3483,3487],{"__ignoreMap":1164},[1168,3348,3349],{"class":1170,"line":1171},[1168,3350,3147],{},[1168,3352,3353],{"class":1170,"line":1177},[1168,3354,1180],{},[1168,3356,3357],{"class":1170,"line":1183},[1168,3358,2368],{},[1168,3360,3361],{"class":1170,"line":1189},[1168,3362,1273],{},[1168,3364,3365],{"class":1170,"line":1196},[1168,3366,3164],{},[1168,3368,3369],{"class":1170,"line":1202},[1168,3370,3169],{},[1168,3372,3373],{"class":1170,"line":1208},[1168,3374,3174],{},[1168,3376,3377],{"class":1170,"line":1264},[1168,3378,3179],{},[1168,3380,3381],{"class":1170,"line":1270},[1168,3382,1285],{},[1168,3384,3385],{"class":1170,"line":1276},[1168,3386,1211],{},[1168,3388,3389],{"class":1170,"line":1282},[1168,3390,1193],{"emptyLinePlaceholder":1192},[1168,3392,3393],{"class":1170,"line":1288},[1168,3394,3196],{},[1168,3396,3397],{"class":1170,"line":2036},[1168,3398,1180],{},[1168,3400,3401],{"class":1170,"line":2042},[1168,3402,3205],{},[1168,3404,3405],{"class":1170,"line":2047},[1168,3406,1193],{"emptyLinePlaceholder":1192},[1168,3408,3409],{"class":1170,"line":2157},[1168,3410,3214],{},[1168,3412,3413],{"class":1170,"line":2430},[1168,3414,1273],{},[1168,3416,3417],{"class":1170,"line":2435},[1168,3418,3223],{},[1168,3420,3421],{"class":1170,"line":2440},[1168,3422,1285],{},[1168,3424,3425],{"class":1170,"line":2445},[1168,3426,1193],{"emptyLinePlaceholder":1192},[1168,3428,3429],{"class":1170,"line":2450},[1168,3430,1199],{},[1168,3432,3433],{"class":1170,"line":2455},[1168,3434,2513],{},[1168,3436,3437],{"class":1170,"line":2460},[1168,3438,1273],{},[1168,3440,3441],{"class":1170,"line":2465},[1168,3442,3443],{},"        if (this == other) return true;\n",[1168,3445,3446],{"class":1170,"line":2470},[1168,3447,3448],{},"        if (!(other instanceof FieldTag)) return false;\n",[1168,3450,3451],{"class":1170,"line":2475},[1168,3452,3453],{},"        FieldTag o = (FieldTag) other;\n",[1168,3455,3456],{"class":1170,"line":2480},[1168,3457,3458],{},"        return this.id == o.id;\n",[1168,3460,3461],{"class":1170,"line":2485},[1168,3462,1285],{},[1168,3464,3465],{"class":1170,"line":2490},[1168,3466,1193],{"emptyLinePlaceholder":1192},[1168,3468,3469],{"class":1170,"line":2495},[1168,3470,1199],{},[1168,3472,3473],{"class":1170,"line":2500},[1168,3474,2563],{},[1168,3476,3477],{"class":1170,"line":2505},[1168,3478,1273],{},[1168,3480,3481],{"class":1170,"line":2510},[1168,3482,3257],{},[1168,3484,3485],{"class":1170,"line":2516},[1168,3486,1285],{},[1168,3488,3489],{"class":1170,"line":2521},[1168,3490,1211],{},[1085,3492,3493,2278,3496,1393,3498,3501,3502,3505,3506,3509,3510,2251,3512,3514,3515,1701,3517,3519,3520,1416,3523,3526,3527,3530,3531,3534,3535,3537,3538,3540,3541,3543,3544,3546,3547,3550,3551,3553,3554,3556,3557,3560,3561,3563,3564,1416,3567,3570,3571,3573,3574,3576],{},[1123,3494,3495],{},"Why this order:",[1088,3497,1129],{},[1088,3499,3500],{},"f",") goes directly above the method it marks, the signature (",[1088,3503,3504],{},"b","), and then comes the opening brace (",[1088,3507,3508],{},"h","). The parameter type is ",[1088,3511,1090],{},[1088,3513,3123],{},", which is what makes this an override of ",[1088,3516,1090],{},[1088,3518,1113],{}," rather than a new overloaded method. The two early-exit checks (",[1088,3521,3522],{},"d",[1088,3524,3525],{},"g",") come next. They're interchangeable: each one returns early on its own, and swapping them never changes the result. The cast (",[1088,3528,3529],{},"a",") must come ",[1486,3532,3533],{},"after"," the ",[1088,3536,1375],{}," check (",[1088,3539,3525],{},"), because casting something that isn't a ",[1088,3542,3123],{}," would throw a ",[1088,3545,1371],{},". The comparison (",[1088,3548,3549],{},"e",") needs the cast variable ",[1088,3552,1496],{},", so it follows ",[1088,3555,3529],{},". The method's closing brace (",[1088,3558,3559],{},"c",") comes last. The program prints ",[1088,3562,1341],{}," because ",[1088,3565,3566],{},"seen",[1088,3568,3569],{},"expected"," are two separate objects, and ",[1088,3572,1330],{}," because their ",[1088,3575,3127],{},"s match.",[1080,3578,3580],{"id":3579},"coding","Coding",[1085,3582,3583,3586],{},[1123,3584,3585],{},"Mode:"," full-program",[1085,3588,3589,3591,3592,3595,3596,3598,3599,3601,3602,3604,3605,3607,3608,3611,3612,3615,3616,3619,3620,3622],{},[1123,3590,3119],{}," Write the class ",[1088,3593,3594],{},"CanDevice"," so it works as an element of a ",[1088,3597,1522],{},". A ",[1088,3600,3594],{}," has\nan ",[1088,3603,1553],{}," CAN ID and a ",[1088,3606,1309],{}," name, set by its constructor ",[1088,3609,3610],{},"CanDevice(int id, String name)",". Two\ndevices count as ",[1123,3613,3614],{},"the same device"," when their ID ",[1123,3617,3618],{},"and"," name are both equal. Override the three\n",[1088,3621,1090],{}," methods the lesson covers:",[1738,3624,3625,3633,3638],{},[1741,3626,3627,3629,3630,1118],{},[1088,3628,1105],{}," returns the name, a space, then the ID in square brackets, like ",[1088,3631,3632],{},"Elevator [12]",[1741,3634,3635,3637],{},[1088,3636,1109],{}," follows the lesson's recipe and compares the ID and the name.",[1741,3639,3640,3642],{},[1088,3641,1117],{}," is built from the same two fields.",[1085,3644,3645,3646,3649,3650,3653,3654,3656,3657,1416,3660,3662,3663,3666,3667,3669,3670,3672,3673,3676,3677,3280],{},"The fixed ",[1088,3647,3648],{},"main"," reads a device count and that many ",[1088,3651,3652],{},"id name"," pairs, adds them to a ",[1088,3655,1522],{},", then\nreads two more devices, ",[1088,3658,3659],{},"probe",[1088,3661,1799],{},". It prints how many ",[1123,3664,3665],{},"distinct"," devices the set holds,\nwhether ",[1088,3668,3659],{}," is in the set, ",[1088,3671,3659],{}," itself, and whether ",[1088,3674,3675],{},"probe.equals(other)",". For the input\n",[1088,3678,3679],{},"3 12 Elevator 12 Elevator 7 Arm 7 Arm 7 Arm",[1159,3681,3684],{"className":3682,"code":3683,"language":2679,"meta":1164},[2677],"2\ntrue\nArm [7]\ntrue\n",[1088,3685,3683],{"__ignoreMap":1164},[1085,3687,3688],{},[1123,3689,3690],{},"Starter:",[1159,3692,3694],{"className":1161,"code":3693,"language":1163,"meta":1164,"style":1164},"import java.util.*;\n\npublic class Main\n{\n    \u002F\u002F Don't change main\n    public static void main(String[] args)\n    {\n        Scanner in = new Scanner(System.in);\n        HashSet\u003CCanDevice> devices = new HashSet\u003CCanDevice>();\n        int count = in.nextInt();\n        for (int i = 0; i \u003C count; i++)\n        {\n            devices.add(new CanDevice(in.nextInt(), in.next()));\n        }\n        CanDevice probe = new CanDevice(in.nextInt(), in.next());\n        CanDevice other = new CanDevice(in.nextInt(), in.next());\n        System.out.println(devices.size());\n        System.out.println(devices.contains(probe));\n        System.out.println(probe);\n        System.out.println(probe.equals(other));\n    }\n}\n\nclass CanDevice\n{\n    \u002F\u002F TODO: the id and name fields, the constructor, toString, equals, and hashCode\n}\n",[1088,3695,3696,3701,3705,3710,3714,3719,3723,3727,3732,3737,3742,3747,3752,3757,3762,3767,3772,3777,3782,3787,3792,3796,3800,3804,3809,3813,3818],{"__ignoreMap":1164},[1168,3697,3698],{"class":1170,"line":1171},[1168,3699,3700],{},"import java.util.*;\n",[1168,3702,3703],{"class":1170,"line":1177},[1168,3704,1193],{"emptyLinePlaceholder":1192},[1168,3706,3707],{"class":1170,"line":1183},[1168,3708,3709],{},"public class Main\n",[1168,3711,3712],{"class":1170,"line":1189},[1168,3713,1180],{},[1168,3715,3716],{"class":1170,"line":1196},[1168,3717,3718],{},"    \u002F\u002F Don't change main\n",[1168,3720,3721],{"class":1170,"line":1202},[1168,3722,2368],{},[1168,3724,3725],{"class":1170,"line":1208},[1168,3726,1273],{},[1168,3728,3729],{"class":1170,"line":1264},[1168,3730,3731],{},"        Scanner in = new Scanner(System.in);\n",[1168,3733,3734],{"class":1170,"line":1270},[1168,3735,3736],{},"        HashSet\u003CCanDevice> devices = new HashSet\u003CCanDevice>();\n",[1168,3738,3739],{"class":1170,"line":1276},[1168,3740,3741],{},"        int count = in.nextInt();\n",[1168,3743,3744],{"class":1170,"line":1282},[1168,3745,3746],{},"        for (int i = 0; i \u003C count; i++)\n",[1168,3748,3749],{"class":1170,"line":1288},[1168,3750,3751],{},"        {\n",[1168,3753,3754],{"class":1170,"line":2036},[1168,3755,3756],{},"            devices.add(new CanDevice(in.nextInt(), in.next()));\n",[1168,3758,3759],{"class":1170,"line":2042},[1168,3760,3761],{},"        }\n",[1168,3763,3764],{"class":1170,"line":2047},[1168,3765,3766],{},"        CanDevice probe = new CanDevice(in.nextInt(), in.next());\n",[1168,3768,3769],{"class":1170,"line":2157},[1168,3770,3771],{},"        CanDevice other = new CanDevice(in.nextInt(), in.next());\n",[1168,3773,3774],{"class":1170,"line":2430},[1168,3775,3776],{},"        System.out.println(devices.size());\n",[1168,3778,3779],{"class":1170,"line":2435},[1168,3780,3781],{},"        System.out.println(devices.contains(probe));\n",[1168,3783,3784],{"class":1170,"line":2440},[1168,3785,3786],{},"        System.out.println(probe);\n",[1168,3788,3789],{"class":1170,"line":2445},[1168,3790,3791],{},"        System.out.println(probe.equals(other));\n",[1168,3793,3794],{"class":1170,"line":2450},[1168,3795,1285],{},[1168,3797,3798],{"class":1170,"line":2455},[1168,3799,1211],{},[1168,3801,3802],{"class":1170,"line":2460},[1168,3803,1193],{"emptyLinePlaceholder":1192},[1168,3805,3806],{"class":1170,"line":2465},[1168,3807,3808],{},"class CanDevice\n",[1168,3810,3811],{"class":1170,"line":2470},[1168,3812,1180],{},[1168,3814,3815],{"class":1170,"line":2475},[1168,3816,3817],{},"    \u002F\u002F TODO: the id and name fields, the constructor, toString, equals, and hashCode\n",[1168,3819,3820],{"class":1170,"line":2480},[1168,3821,1211],{},[1085,3823,3824],{},[1123,3825,3826],{},"Scenario 1 (visible):",[1085,3828,3829],{},[1123,3830,3831],{},"Input:",[1159,3833,3836],{"className":3834,"code":3835,"language":2679,"meta":1164},[2677],"3 12 Elevator 12 Elevator 7 Arm 7 Arm 7 Arm\n",[1088,3837,3835],{"__ignoreMap":1164},[1085,3839,3840],{},[1123,3841,3842],{},"Expected output:",[1159,3844,3846],{"className":3845,"code":3683,"language":2679,"meta":1164},[2677],[1088,3847,3683],{"__ignoreMap":1164},[1085,3849,3850],{},[1123,3851,3852],{},"Scenario 2 (visible):",[1085,3854,3855],{},[1123,3856,3831],{},[1159,3858,3861],{"className":3859,"code":3860,"language":2679,"meta":1164},[2677],"2 1 Intake 2 Shooter 3 Climber 3 Climber\n",[1088,3862,3860],{"__ignoreMap":1164},[1085,3864,3865],{},[1123,3866,3842],{},[1159,3868,3871],{"className":3869,"code":3870,"language":2679,"meta":1164},[2677],"2\nfalse\nClimber [3]\ntrue\n",[1088,3872,3870],{"__ignoreMap":1164},[1085,3874,3875],{},[1123,3876,3877],{},"Scenario 3 (hidden):",[1085,3879,3880],{},[1123,3881,3831],{},[1159,3883,3886],{"className":3884,"code":3885,"language":2679,"meta":1164},[2677],"3 5 Left 5 Right 5 Left 5 Right 5 Left\n",[1088,3887,3885],{"__ignoreMap":1164},[1085,3889,3890],{},[1123,3891,3842],{},[1159,3893,3896],{"className":3894,"code":3895,"language":2679,"meta":1164},[2677],"2\ntrue\nRight [5]\nfalse\n",[1088,3897,3895],{"__ignoreMap":1164},[1085,3899,3900],{},[1123,3901,3902],{},"Scenario 4 (hidden):",[1085,3904,3905],{},[1123,3906,3831],{},[1159,3908,3911],{"className":3909,"code":3910,"language":2679,"meta":1164},[2677],"4 9 Wrist 8 Wrist 9 Wrist 9 Wrist 8 Wrist 9 Wrist\n",[1088,3912,3910],{"__ignoreMap":1164},[1085,3914,3915],{},[1123,3916,3842],{},[1159,3918,3921],{"className":3919,"code":3920,"language":2679,"meta":1164},[2677],"2\ntrue\nWrist [8]\nfalse\n",[1088,3922,3920],{"__ignoreMap":1164},[1085,3924,3925],{},[1123,3926,3927],{},"Scenario 5 (hidden):",[1085,3929,3930],{},[1123,3931,3831],{},[1159,3933,3936],{"className":3934,"code":3935,"language":2679,"meta":1164},[2677],"2 4 Gyro 6 Camera 6 Gyro 6 Gyro\n",[1088,3937,3935],{"__ignoreMap":1164},[1085,3939,3940],{},[1123,3941,3842],{},[1159,3943,3946],{"className":3944,"code":3945,"language":2679,"meta":1164},[2677],"2\nfalse\nGyro [6]\ntrue\n",[1088,3947,3945],{"__ignoreMap":1164},[1085,3949,3950],{},[1123,3951,3952],{},"Solution:",[1159,3954,3956],{"className":1161,"code":3955,"language":1163,"meta":1164,"style":1164},"import java.util.*;\n\npublic class Main\n{\n    \u002F\u002F Don't change main\n    public static void main(String[] args)\n    {\n        Scanner in = new Scanner(System.in);\n        HashSet\u003CCanDevice> devices = new HashSet\u003CCanDevice>();\n        int count = in.nextInt();\n        for (int i = 0; i \u003C count; i++)\n        {\n            devices.add(new CanDevice(in.nextInt(), in.next()));\n        }\n        CanDevice probe = new CanDevice(in.nextInt(), in.next());\n        CanDevice other = new CanDevice(in.nextInt(), in.next());\n        System.out.println(devices.size());\n        System.out.println(devices.contains(probe));\n        System.out.println(probe);\n        System.out.println(probe.equals(other));\n    }\n}\n\nclass CanDevice\n{\n    private int id;\n    private String name;\n\n    public CanDevice(int id, String name)\n    {\n        this.id = id;\n        this.name = name;\n    }\n\n    @Override\n    public String toString()\n    {\n        return name + \" [\" + id + \"]\";\n    }\n\n    @Override\n    public boolean equals(Object other)\n    {\n        if (this == other) return true;\n        if (!(other instanceof CanDevice)) return false;\n        CanDevice o = (CanDevice) other;\n        return this.id == o.id && this.name.equals(o.name);\n    }\n\n    @Override\n    public int hashCode()\n    {\n        return Objects.hash(id, name);\n    }\n}\n",[1088,3957,3958,3962,3966,3970,3974,3978,3982,3986,3990,3994,3998,4002,4006,4010,4014,4018,4022,4026,4030,4034,4038,4042,4046,4050,4054,4058,4062,4067,4071,4076,4080,4084,4089,4093,4097,4101,4105,4109,4114,4118,4122,4126,4130,4134,4138,4143,4148,4153,4157,4161,4165,4169,4173,4178,4182],{"__ignoreMap":1164},[1168,3959,3960],{"class":1170,"line":1171},[1168,3961,3700],{},[1168,3963,3964],{"class":1170,"line":1177},[1168,3965,1193],{"emptyLinePlaceholder":1192},[1168,3967,3968],{"class":1170,"line":1183},[1168,3969,3709],{},[1168,3971,3972],{"class":1170,"line":1189},[1168,3973,1180],{},[1168,3975,3976],{"class":1170,"line":1196},[1168,3977,3718],{},[1168,3979,3980],{"class":1170,"line":1202},[1168,3981,2368],{},[1168,3983,3984],{"class":1170,"line":1208},[1168,3985,1273],{},[1168,3987,3988],{"class":1170,"line":1264},[1168,3989,3731],{},[1168,3991,3992],{"class":1170,"line":1270},[1168,3993,3736],{},[1168,3995,3996],{"class":1170,"line":1276},[1168,3997,3741],{},[1168,3999,4000],{"class":1170,"line":1282},[1168,4001,3746],{},[1168,4003,4004],{"class":1170,"line":1288},[1168,4005,3751],{},[1168,4007,4008],{"class":1170,"line":2036},[1168,4009,3756],{},[1168,4011,4012],{"class":1170,"line":2042},[1168,4013,3761],{},[1168,4015,4016],{"class":1170,"line":2047},[1168,4017,3766],{},[1168,4019,4020],{"class":1170,"line":2157},[1168,4021,3771],{},[1168,4023,4024],{"class":1170,"line":2430},[1168,4025,3776],{},[1168,4027,4028],{"class":1170,"line":2435},[1168,4029,3781],{},[1168,4031,4032],{"class":1170,"line":2440},[1168,4033,3786],{},[1168,4035,4036],{"class":1170,"line":2445},[1168,4037,3791],{},[1168,4039,4040],{"class":1170,"line":2450},[1168,4041,1285],{},[1168,4043,4044],{"class":1170,"line":2455},[1168,4045,1211],{},[1168,4047,4048],{"class":1170,"line":2460},[1168,4049,1193],{"emptyLinePlaceholder":1192},[1168,4051,4052],{"class":1170,"line":2465},[1168,4053,3808],{},[1168,4055,4056],{"class":1170,"line":2470},[1168,4057,1180],{},[1168,4059,4060],{"class":1170,"line":2475},[1168,4061,3205],{},[1168,4063,4064],{"class":1170,"line":2480},[1168,4065,4066],{},"    private String name;\n",[1168,4068,4069],{"class":1170,"line":2485},[1168,4070,1193],{"emptyLinePlaceholder":1192},[1168,4072,4073],{"class":1170,"line":2490},[1168,4074,4075],{},"    public CanDevice(int id, String name)\n",[1168,4077,4078],{"class":1170,"line":2495},[1168,4079,1273],{},[1168,4081,4082],{"class":1170,"line":2500},[1168,4083,3223],{},[1168,4085,4086],{"class":1170,"line":2505},[1168,4087,4088],{},"        this.name = name;\n",[1168,4090,4091],{"class":1170,"line":2510},[1168,4092,1285],{},[1168,4094,4095],{"class":1170,"line":2516},[1168,4096,1193],{"emptyLinePlaceholder":1192},[1168,4098,4099],{"class":1170,"line":2521},[1168,4100,1199],{},[1168,4102,4103],{"class":1170,"line":2527},[1168,4104,1267],{},[1168,4106,4107],{"class":1170,"line":2533},[1168,4108,1273],{},[1168,4110,4111],{"class":1170,"line":2539},[1168,4112,4113],{},"        return name + \" [\" + id + \"]\";\n",[1168,4115,4116],{"class":1170,"line":2545},[1168,4117,1285],{},[1168,4119,4120],{"class":1170,"line":2550},[1168,4121,1193],{"emptyLinePlaceholder":1192},[1168,4123,4124],{"class":1170,"line":2555},[1168,4125,1199],{},[1168,4127,4128],{"class":1170,"line":2560},[1168,4129,2513],{},[1168,4131,4132],{"class":1170,"line":2566},[1168,4133,1273],{},[1168,4135,4136],{"class":1170,"line":2571},[1168,4137,3443],{},[1168,4139,4140],{"class":1170,"line":2577},[1168,4141,4142],{},"        if (!(other instanceof CanDevice)) return false;\n",[1168,4144,4145],{"class":1170,"line":2582},[1168,4146,4147],{},"        CanDevice o = (CanDevice) other;\n",[1168,4149,4150],{"class":1170,"line":2587},[1168,4151,4152],{},"        return this.id == o.id && this.name.equals(o.name);\n",[1168,4154,4155],{"class":1170,"line":2592},[1168,4156,1285],{},[1168,4158,4159],{"class":1170,"line":2597},[1168,4160,1193],{"emptyLinePlaceholder":1192},[1168,4162,4163],{"class":1170,"line":2602},[1168,4164,1199],{},[1168,4166,4167],{"class":1170,"line":2607},[1168,4168,2563],{},[1168,4170,4171],{"class":1170,"line":2612},[1168,4172,1273],{},[1168,4174,4175],{"class":1170,"line":2617},[1168,4176,4177],{},"        return Objects.hash(id, name);\n",[1168,4179,4180],{"class":1170,"line":2622},[1168,4181,1285],{},[1168,4183,4184],{"class":1170,"line":2627},[1168,4185,1211],{},[1085,4187,4188,4190,4191,4193,4194,4196,4197,4199,4200,1416,4202,4204,4205,4207,4208,4210,4211,4214,4215,4217,4218,4220,4221,4224,4225,4227,4228,4230,4231,3563,4233,4235,4236,4238,4239,4241,4242,4244,4245,1118],{},[1123,4189,3035],{}," A ",[1088,4192,1522],{}," first uses ",[1088,4195,1117],{}," to pick where to look, then ",[1088,4198,1526],{}," to\nconfirm a match, so both have to agree and both have to use the same fields (",[1088,4201,3127],{},[1088,4203,1707],{},"). If\n",[1088,4206,1113],{}," is written without ",[1088,4209,1779],{},", two equal devices usually hash to different places and the\nset keeps both, so ",[1088,4212,4213],{},"size()"," comes out too large and ",[1088,4216,1649],{}," can say ",[1088,4219,1341],{}," for a device that\nis really there. Writing the parameter as ",[1088,4222,4223],{},"equals(CanDevice other)"," is a different method\n(overloading), which the set never calls; ",[1088,4226,1129],{}," turns that mistake into a compile error. The\n",[1088,4229,3127],{}," comparison uses ",[1088,4232,1305],{},[1088,4234,3127],{}," is a primitive ",[1088,4237,1553],{},", but ",[1088,4240,1707],{}," is a ",[1088,4243,1309],{}," and needs\n",[1088,4246,4247],{},".equals",[1904,4249,1906],{},{"title":1164,"searchDepth":1177,"depth":1177,"links":4251},[4252,4253,4254],{"id":2849,"depth":1177,"text":2850},{"id":3113,"depth":1177,"text":3114},{"id":3579,"depth":1177,"text":3580},{"outlineRef":1920,"pairsWith":2836,"status":4256},"new — authored exercises (Multiple Choice + Micro-Parsons + Coding)",{"title":968,"description":1164},"WJnZJEiMtN55KmY41Zcij-JGyBdrm6FsgVy0jQvZzuc",1792718166126]