[{"data":1,"prerenderedAt":3777},["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.3":1070,"item-example-full-ch17-inheritance-and-abstractions-17.3":1429,"item-exercise-full-ch17-inheritance-and-abstractions-17.3":2097},[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":218,"body":1072,"description":1143,"extension":1423,"meta":1424,"navigation":1251,"path":217,"seo":1427,"stem":219,"__hash__":1428},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies.md",{"type":1073,"value":1074,"toc":1415},"minimark",[1075,1079,1084,1126,1130,1137,1166,1174,1189,1193,1196,1265,1279,1299,1303,1323,1327,1379,1383,1400,1411],[1076,1077,218],"h1",{"id":1078},"inheritance-hierarchies",[1080,1081,1083],"h2",{"id":1082},"multiple-subclasses-one-superclass","Multiple Subclasses, One Superclass",[1085,1086,1087,1088,1092,1093,1097,1098,1101,1102,1105,1106,1109,1110,1113,1114,1116,1117,1120,1121,1125],"p",{},"An ",[1089,1090,1091],"strong",{},"inheritance hierarchy"," forms when several subclasses inherit (directly, or through another subclass) from a common superclass. ",[1094,1095,1096],"code",{},"Intake",", ",[1094,1099,1100],{},"Shooter",", and ",[1094,1103,1104],{},"Climber"," all extending ",[1094,1107,1108],{},"RobotPart"," (each with a constructor that passes its name to ",[1094,1111,1112],{},"super(...)",", like ",[1094,1115,1096],{},"'s) is a small hierarchy; ",[1094,1118,1119],{},"Object"," sits at the very top of ",[1122,1123,1124],"em",{},"every"," hierarchy in Java, since every class ultimately inherits from it (Lesson 17.4).",[1080,1127,1129],{"id":1128},"a-superclass-reference-can-hold-any-subclass-object","A Superclass Reference Can Hold Any Subclass Object",[1085,1131,1132,1133,1136],{},"A variable typed as the superclass can refer to an object of that class ",[1122,1134,1135],{},"or any of its subclasses",":",[1138,1139,1144],"pre",{"className":1140,"code":1141,"language":1142,"meta":1143,"style":1143},"language-java shiki shiki-themes github-light github-dark","RobotPart p1 = new RobotPart(\"Generic\");\nRobotPart p2 = new Intake(\"Front Intake\");   \u002F\u002F legal — an Intake IS-A RobotPart\nRobotPart p3 = new Climber(\"Left Climber\");  \u002F\u002F legal — a Climber IS-A RobotPart\n","java","",[1094,1145,1146,1154,1160],{"__ignoreMap":1143},[1147,1148,1151],"span",{"class":1149,"line":1150},"line",1,[1147,1152,1153],{},"RobotPart p1 = new RobotPart(\"Generic\");\n",[1147,1155,1157],{"class":1149,"line":1156},2,[1147,1158,1159],{},"RobotPart p2 = new Intake(\"Front Intake\");   \u002F\u002F legal — an Intake IS-A RobotPart\n",[1147,1161,1163],{"class":1149,"line":1162},3,[1147,1164,1165],{},"RobotPart p3 = new Climber(\"Left Climber\");  \u002F\u002F legal — a Climber IS-A RobotPart\n",[1085,1167,1168,1169,1171,1172,1136],{},"The reverse doesn't work — a subclass-typed variable cannot hold a plain superclass object, since not every ",[1094,1170,1108],{}," is specifically an ",[1094,1173,1096],{},[1138,1175,1177],{"className":1140,"code":1176,"language":1142,"meta":1143,"style":1143},"\u002F\u002F ERROR — a RobotPart isn't necessarily an Intake\nIntake i = new RobotPart(\"Generic\");\n",[1094,1178,1179,1184],{"__ignoreMap":1143},[1147,1180,1181],{"class":1149,"line":1150},[1147,1182,1183],{},"\u002F\u002F ERROR — a RobotPart isn't necessarily an Intake\n",[1147,1185,1186],{"class":1149,"line":1156},[1147,1187,1188],{},"Intake i = new RobotPart(\"Generic\");\n",[1080,1190,1192],{"id":1191},"why-this-matters-one-parameter-type-every-subclass","Why This Matters: One Parameter Type, Every Subclass",[1085,1194,1195],{},"A method, array, or collection typed against the superclass automatically accepts every subclass too — this is what makes managing all of a robot's parts from one place possible:",[1138,1197,1199],{"className":1140,"code":1198,"language":1142,"meta":1143,"style":1143},"public void stopAll(RobotPart[] parts)\n{\n    for (RobotPart p : parts)\n    {\n        \u002F\u002F works for an Intake, a Climber, a Shooter — anything extending RobotPart\n        p.stop();\n    }\n}\n\nRobotPart[] parts = { new Intake(\"Front\"), new Climber(\"Left\"), new Shooter(\"Main\") };\nstopAll(parts);\n",[1094,1200,1201,1206,1211,1216,1222,1228,1234,1240,1246,1253,1259],{"__ignoreMap":1143},[1147,1202,1203],{"class":1149,"line":1150},[1147,1204,1205],{},"public void stopAll(RobotPart[] parts)\n",[1147,1207,1208],{"class":1149,"line":1156},[1147,1209,1210],{},"{\n",[1147,1212,1213],{"class":1149,"line":1162},[1147,1214,1215],{},"    for (RobotPart p : parts)\n",[1147,1217,1219],{"class":1149,"line":1218},4,[1147,1220,1221],{},"    {\n",[1147,1223,1225],{"class":1149,"line":1224},5,[1147,1226,1227],{},"        \u002F\u002F works for an Intake, a Climber, a Shooter — anything extending RobotPart\n",[1147,1229,1231],{"class":1149,"line":1230},6,[1147,1232,1233],{},"        p.stop();\n",[1147,1235,1237],{"class":1149,"line":1236},7,[1147,1238,1239],{},"    }\n",[1147,1241,1243],{"class":1149,"line":1242},8,[1147,1244,1245],{},"}\n",[1147,1247,1249],{"class":1149,"line":1248},9,[1147,1250,1252],{"emptyLinePlaceholder":1251},true,"\n",[1147,1254,1256],{"class":1149,"line":1255},10,[1147,1257,1258],{},"RobotPart[] parts = { new Intake(\"Front\"), new Climber(\"Left\"), new Shooter(\"Main\") };\n",[1147,1260,1262],{"class":1149,"line":1261},11,[1147,1263,1264],{},"stopAll(parts);\n",[1085,1266,1267,1268,1271,1272,1097,1274,1101,1276,1278],{},"The same holds for collections — an ",[1094,1269,1270],{},"ArrayList\u003CRobotPart>"," happily holds ",[1094,1273,1096],{},[1094,1275,1104],{},[1094,1277,1100],{}," objects side by side:",[1138,1280,1282],{"className":1140,"code":1281,"language":1142,"meta":1143,"style":1143},"ArrayList\u003CRobotPart> allParts = new ArrayList\u003CRobotPart>();\nallParts.add(new Intake(\"Front\"));\nallParts.add(new Climber(\"Left\"));\n",[1094,1283,1284,1289,1294],{"__ignoreMap":1143},[1147,1285,1286],{"class":1149,"line":1150},[1147,1287,1288],{},"ArrayList\u003CRobotPart> allParts = new ArrayList\u003CRobotPart>();\n",[1147,1290,1291],{"class":1149,"line":1156},[1147,1292,1293],{},"allParts.add(new Intake(\"Front\"));\n",[1147,1295,1296],{"class":1149,"line":1162},[1147,1297,1298],{},"allParts.add(new Climber(\"Left\"));\n",[1080,1300,1302],{"id":1301},"which-method-actually-runs","Which Method Actually Runs?",[1085,1304,1305,1306,1309,1310,1313,1314,1316,1317,1319,1320,1322],{},"When a method typed against the superclass is called on an object that's actually a subclass instance, Java runs ",[1122,1307,1308],{},"that object's"," actual version of the method — decided by its real runtime type, not the variable's declared type. This is the foundation of ",[1089,1311,1312],{},"polymorphism",", covered in full in Lesson 18.3 — for now, the key idea is just that a ",[1094,1315,1108],{},"-typed variable holding an ",[1094,1318,1096],{}," object still calls ",[1094,1321,1096],{},"'s own overridden methods, if it has any (overriding, Lesson 18.1).",[1080,1324,1326],{"id":1325},"common-pitfalls","Common Pitfalls",[1328,1329,1330,1347,1363],"ul",{},[1331,1332,1333,1336,1337,1340,1341,1343,1344,1346],"li",{},[1089,1334,1335],{},"Trying to assign a superclass object to a subclass-typed variable."," ",[1094,1338,1339],{},"Intake i = new RobotPart(...);"," is a compile error — not every ",[1094,1342,1108],{}," is an ",[1094,1345,1096],{},". This only ever works the other direction (superclass variable, subclass object).",[1331,1348,1349,1359,1360,1362],{},[1089,1350,1351,1352,1355,1356,1358],{},"Thinking a ",[1094,1353,1354],{},"RobotPart[]"," array can only hold plain ",[1094,1357,1108],{}," objects."," It can hold any mix of ",[1094,1361,1108],{}," and its subclasses — that flexibility is the entire point of typing the array against the superclass.",[1331,1364,1365,1368,1369,1371,1372,1375,1376,1378],{},[1089,1366,1367],{},"Forgetting which method version actually runs."," Even though a variable is declared ",[1094,1370,1108],{},", calling a method on it runs the object's ",[1122,1373,1374],{},"real"," class's version — not necessarily ",[1094,1377,1108],{},"'s own.",[1080,1380,1382],{"id":1381},"key-takeaways","Key Takeaways",[1328,1384,1385,1391,1394,1397],{},[1331,1386,1387,1388,1390],{},"Several subclasses inheriting from one common superclass form an inheritance hierarchy, with ",[1094,1389,1119],{}," at the top of every hierarchy in Java.",[1331,1392,1393],{},"A superclass-typed variable, array, or collection can hold objects of that class or any of its subclasses — never the reverse.",[1331,1395,1396],{},"This lets one method signature, one array type, or one collection type work seamlessly across an entire family of related robot-part classes.",[1331,1398,1399],{},"Which method actually executes depends on the object's real runtime type, not the variable's declared type — the basis of polymorphism (Lesson 18.3).",[1085,1401,1402,1403,1406,1407,1410],{},"Derived from ",[1094,1404,1405],{},"csawesome-2026",": ",[1094,1408,1409],{},"unit-5-inheritance-optional\u002F5.05-inheritance-hierarchies.md"," (CSA 5.5)",[1412,1413,1414],"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":1143,"searchDepth":1156,"depth":1156,"links":1416},[1417,1418,1419,1420,1421,1422],{"id":1082,"depth":1156,"text":1083},{"id":1128,"depth":1156,"text":1129},{"id":1191,"depth":1156,"text":1192},{"id":1301,"depth":1156,"text":1302},{"id":1325,"depth":1156,"text":1326},{"id":1381,"depth":1156,"text":1382},"md",{"outlineRef":1425,"status":1426},"17.3 — Inheritance Hierarchies (CSA 5.5)","new — authored lesson",{"title":218,"description":1143},"w5B3-vZR2j83yFIJgUIn5crruwgUzLEd5Q0WodK8qEo",{"id":1430,"title":651,"body":1431,"description":1143,"extension":1423,"meta":2092,"navigation":1251,"path":650,"seo":2095,"stem":652,"__hash__":2096},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies.md",{"type":1073,"value":1432,"toc":2081},[1433,1436,1440,1443,1447,1517,1524,1528,1534,1606,1620,1624,1638,1647,1653,1662,1666,1672,1708,1728,1732,1966,1980,1984,1992,2005,2009,2019,2039,2049,2053,2079],[1076,1434,651],{"id":1435},"inheritance-hierarchies-worked-example",[1080,1437,1439],{"id":1438},"problem","Problem",[1085,1441,1442],{},"Before a match, the robot collects any problems it finds into a list of alerts: a low battery, a CAN device that isn't responding, or a general message like a disconnected camera. Each kind builds its message differently, but all of them are displayed the same way. Write one method that shows every alert, whatever kind it is.",[1080,1444,1446],{"id":1445},"step-1-write-the-superclass","Step 1: Write the Superclass",[1138,1448,1450],{"className":1140,"code":1449,"language":1142,"meta":1143,"style":1143},"class Alert\n{\n    private String message;\n\n    public Alert(String message)\n    {\n        this.message = message;\n    }\n\n    public void show()\n    {\n        System.out.println(\"[ALERT] \" + message);\n    }\n}\n",[1094,1451,1452,1457,1461,1466,1470,1475,1479,1484,1488,1492,1497,1501,1507,1512],{"__ignoreMap":1143},[1147,1453,1454],{"class":1149,"line":1150},[1147,1455,1456],{},"class Alert\n",[1147,1458,1459],{"class":1149,"line":1156},[1147,1460,1210],{},[1147,1462,1463],{"class":1149,"line":1162},[1147,1464,1465],{},"    private String message;\n",[1147,1467,1468],{"class":1149,"line":1218},[1147,1469,1252],{"emptyLinePlaceholder":1251},[1147,1471,1472],{"class":1149,"line":1224},[1147,1473,1474],{},"    public Alert(String message)\n",[1147,1476,1477],{"class":1149,"line":1230},[1147,1478,1221],{},[1147,1480,1481],{"class":1149,"line":1236},[1147,1482,1483],{},"        this.message = message;\n",[1147,1485,1486],{"class":1149,"line":1242},[1147,1487,1239],{},[1147,1489,1490],{"class":1149,"line":1248},[1147,1491,1252],{"emptyLinePlaceholder":1251},[1147,1493,1494],{"class":1149,"line":1255},[1147,1495,1496],{},"    public void show()\n",[1147,1498,1499],{"class":1149,"line":1261},[1147,1500,1221],{},[1147,1502,1504],{"class":1149,"line":1503},12,[1147,1505,1506],{},"        System.out.println(\"[ALERT] \" + message);\n",[1147,1508,1510],{"class":1149,"line":1509},13,[1147,1511,1239],{},[1147,1513,1515],{"class":1149,"line":1514},14,[1147,1516,1245],{},[1085,1518,1519,1520,1523],{},"This is the one place the display format lives. A general alert, like a disconnected camera, can be a plain ",[1094,1521,1522],{},"Alert"," object.",[1080,1525,1527],{"id":1526},"step-2-write-two-subclasses","Step 2: Write Two Subclasses",[1085,1529,1530,1531,1533],{},"Each subclass takes the value it cares about and builds its message from it. The message is passed up with ",[1094,1532,1112],{}," (Lesson 17.2):",[1138,1535,1537],{"className":1140,"code":1536,"language":1142,"meta":1143,"style":1143},"class BatteryAlert extends Alert\n{\n    public BatteryAlert(double volts)\n    {\n        super(\"Battery low: \" + volts + \"V\");\n    }\n}\n\nclass CanAlert extends Alert\n{\n    public CanAlert(int deviceId)\n    {\n        super(\"CAN device \" + deviceId + \" not responding\");\n    }\n}\n",[1094,1538,1539,1544,1548,1553,1557,1562,1566,1570,1574,1579,1583,1588,1592,1597,1601],{"__ignoreMap":1143},[1147,1540,1541],{"class":1149,"line":1150},[1147,1542,1543],{},"class BatteryAlert extends Alert\n",[1147,1545,1546],{"class":1149,"line":1156},[1147,1547,1210],{},[1147,1549,1550],{"class":1149,"line":1162},[1147,1551,1552],{},"    public BatteryAlert(double volts)\n",[1147,1554,1555],{"class":1149,"line":1218},[1147,1556,1221],{},[1147,1558,1559],{"class":1149,"line":1224},[1147,1560,1561],{},"        super(\"Battery low: \" + volts + \"V\");\n",[1147,1563,1564],{"class":1149,"line":1230},[1147,1565,1239],{},[1147,1567,1568],{"class":1149,"line":1236},[1147,1569,1245],{},[1147,1571,1572],{"class":1149,"line":1242},[1147,1573,1252],{"emptyLinePlaceholder":1251},[1147,1575,1576],{"class":1149,"line":1248},[1147,1577,1578],{},"class CanAlert extends Alert\n",[1147,1580,1581],{"class":1149,"line":1255},[1147,1582,1210],{},[1147,1584,1585],{"class":1149,"line":1261},[1147,1586,1587],{},"    public CanAlert(int deviceId)\n",[1147,1589,1590],{"class":1149,"line":1503},[1147,1591,1221],{},[1147,1593,1594],{"class":1149,"line":1509},[1147,1595,1596],{},"        super(\"CAN device \" + deviceId + \" not responding\");\n",[1147,1598,1599],{"class":1149,"line":1514},[1147,1600,1239],{},[1147,1602,1604],{"class":1149,"line":1603},15,[1147,1605,1245],{},[1085,1607,1608,1097,1610,1101,1613,1616,1617,1619],{},[1094,1609,1522],{},[1094,1611,1612],{},"BatteryAlert",[1094,1614,1615],{},"CanAlert"," now form a small hierarchy: two subclasses sharing one superclass, and ",[1094,1618,1119],{}," above all of them.",[1080,1621,1623],{"id":1622},"step-3-hold-a-subclass-object-in-a-superclass-variable","Step 3: Hold a Subclass Object in a Superclass Variable",[1085,1625,1626,1627,1336,1629,1336,1632,1634,1635,1637],{},"Because a ",[1094,1628,1612],{},[1122,1630,1631],{},"is an",[1094,1633,1522],{},", an ",[1094,1636,1522],{},"-typed variable can hold one:",[1138,1639,1641],{"className":1140,"code":1640,"language":1142,"meta":1143,"style":1143},"Alert first = new BatteryAlert(11.4);   \u002F\u002F legal — a BatteryAlert IS-AN Alert\n",[1094,1642,1643],{"__ignoreMap":1143},[1147,1644,1645],{"class":1149,"line":1150},[1147,1646,1640],{},[1085,1648,1649,1650,1652],{},"The reverse doesn't compile, since not every ",[1094,1651,1522],{}," is a battery alert:",[1138,1654,1656],{"className":1140,"code":1655,"language":1142,"meta":1143,"style":1143},"BatteryAlert b = new Alert(\"Camera disconnected\"); \u002F\u002F error: incompatible types\n",[1094,1657,1658],{"__ignoreMap":1143},[1147,1659,1660],{"class":1149,"line":1150},[1147,1661,1655],{},[1080,1663,1665],{"id":1664},"step-4-one-method-for-the-whole-hierarchy","Step 4: One Method for the Whole Hierarchy",[1085,1667,1668,1669,1671],{},"Type the method's parameter against the superclass, and it accepts an array holding any mix of ",[1094,1670,1522],{}," and its subclasses:",[1138,1673,1675],{"className":1140,"code":1674,"language":1142,"meta":1143,"style":1143},"public static void showAll(Alert[] alerts)\n{\n    for (Alert a : alerts)\n    {\n        a.show();\n    }\n}\n",[1094,1676,1677,1682,1686,1691,1695,1700,1704],{"__ignoreMap":1143},[1147,1678,1679],{"class":1149,"line":1150},[1147,1680,1681],{},"public static void showAll(Alert[] alerts)\n",[1147,1683,1684],{"class":1149,"line":1156},[1147,1685,1210],{},[1147,1687,1688],{"class":1149,"line":1162},[1147,1689,1690],{},"    for (Alert a : alerts)\n",[1147,1692,1693],{"class":1149,"line":1218},[1147,1694,1221],{},[1147,1696,1697],{"class":1149,"line":1224},[1147,1698,1699],{},"        a.show();\n",[1147,1701,1702],{"class":1149,"line":1230},[1147,1703,1239],{},[1147,1705,1706],{"class":1149,"line":1236},[1147,1707,1245],{},[1085,1709,1710,1711,1714,1715,1717,1718,1721,1722,1724,1725,1727],{},"Inside the loop, ",[1094,1712,1713],{},"a"," is typed ",[1094,1716,1522],{},", so all the loop knows is that every element has a ",[1094,1719,1720],{},"show()"," method — which every element does, because ",[1094,1723,1612],{}," and ",[1094,1726,1615],{}," both inherit it.",[1080,1729,1731],{"id":1730},"step-5-put-it-together","Step 5: Put It Together",[1138,1733,1735],{"className":1140,"code":1734,"language":1142,"meta":1143,"style":1143},"public class AlertDemo\n{\n    public static void showAll(Alert[] alerts)\n    {\n        for (Alert a : alerts)\n        {\n            a.show();\n        }\n    }\n\n    public static void main(String[] args)\n    {\n        Alert[] activeAlerts = { new BatteryAlert(11.4), new CanAlert(12), new Alert(\"Camera disconnected\") };\n        showAll(activeAlerts);\n    }\n}\n\nclass Alert\n{\n    private String message;\n\n    public Alert(String message)\n    {\n        this.message = message;\n    }\n\n    public void show()\n    {\n        System.out.println(\"[ALERT] \" + message);\n    }\n}\n\nclass BatteryAlert extends Alert\n{\n    public BatteryAlert(double volts)\n    {\n        super(\"Battery low: \" + volts + \"V\");\n    }\n}\n\nclass CanAlert extends Alert\n{\n    public CanAlert(int deviceId)\n    {\n        super(\"CAN device \" + deviceId + \" not responding\");\n    }\n}\n",[1094,1736,1737,1742,1746,1751,1755,1760,1765,1770,1775,1779,1783,1788,1792,1797,1802,1806,1811,1816,1821,1826,1831,1836,1841,1846,1851,1856,1861,1866,1871,1876,1881,1886,1891,1896,1901,1906,1911,1916,1921,1926,1931,1936,1941,1946,1951,1956,1961],{"__ignoreMap":1143},[1147,1738,1739],{"class":1149,"line":1150},[1147,1740,1741],{},"public class AlertDemo\n",[1147,1743,1744],{"class":1149,"line":1156},[1147,1745,1210],{},[1147,1747,1748],{"class":1149,"line":1162},[1147,1749,1750],{},"    public static void showAll(Alert[] alerts)\n",[1147,1752,1753],{"class":1149,"line":1218},[1147,1754,1221],{},[1147,1756,1757],{"class":1149,"line":1224},[1147,1758,1759],{},"        for (Alert a : alerts)\n",[1147,1761,1762],{"class":1149,"line":1230},[1147,1763,1764],{},"        {\n",[1147,1766,1767],{"class":1149,"line":1236},[1147,1768,1769],{},"            a.show();\n",[1147,1771,1772],{"class":1149,"line":1242},[1147,1773,1774],{},"        }\n",[1147,1776,1777],{"class":1149,"line":1248},[1147,1778,1239],{},[1147,1780,1781],{"class":1149,"line":1255},[1147,1782,1252],{"emptyLinePlaceholder":1251},[1147,1784,1785],{"class":1149,"line":1261},[1147,1786,1787],{},"    public static void main(String[] args)\n",[1147,1789,1790],{"class":1149,"line":1503},[1147,1791,1221],{},[1147,1793,1794],{"class":1149,"line":1509},[1147,1795,1796],{},"        Alert[] activeAlerts = { new BatteryAlert(11.4), new CanAlert(12), new Alert(\"Camera disconnected\") };\n",[1147,1798,1799],{"class":1149,"line":1514},[1147,1800,1801],{},"        showAll(activeAlerts);\n",[1147,1803,1804],{"class":1149,"line":1603},[1147,1805,1239],{},[1147,1807,1809],{"class":1149,"line":1808},16,[1147,1810,1245],{},[1147,1812,1814],{"class":1149,"line":1813},17,[1147,1815,1252],{"emptyLinePlaceholder":1251},[1147,1817,1819],{"class":1149,"line":1818},18,[1147,1820,1456],{},[1147,1822,1824],{"class":1149,"line":1823},19,[1147,1825,1210],{},[1147,1827,1829],{"class":1149,"line":1828},20,[1147,1830,1465],{},[1147,1832,1834],{"class":1149,"line":1833},21,[1147,1835,1252],{"emptyLinePlaceholder":1251},[1147,1837,1839],{"class":1149,"line":1838},22,[1147,1840,1474],{},[1147,1842,1844],{"class":1149,"line":1843},23,[1147,1845,1221],{},[1147,1847,1849],{"class":1149,"line":1848},24,[1147,1850,1483],{},[1147,1852,1854],{"class":1149,"line":1853},25,[1147,1855,1239],{},[1147,1857,1859],{"class":1149,"line":1858},26,[1147,1860,1252],{"emptyLinePlaceholder":1251},[1147,1862,1864],{"class":1149,"line":1863},27,[1147,1865,1496],{},[1147,1867,1869],{"class":1149,"line":1868},28,[1147,1870,1221],{},[1147,1872,1874],{"class":1149,"line":1873},29,[1147,1875,1506],{},[1147,1877,1879],{"class":1149,"line":1878},30,[1147,1880,1239],{},[1147,1882,1884],{"class":1149,"line":1883},31,[1147,1885,1245],{},[1147,1887,1889],{"class":1149,"line":1888},32,[1147,1890,1252],{"emptyLinePlaceholder":1251},[1147,1892,1894],{"class":1149,"line":1893},33,[1147,1895,1543],{},[1147,1897,1899],{"class":1149,"line":1898},34,[1147,1900,1210],{},[1147,1902,1904],{"class":1149,"line":1903},35,[1147,1905,1552],{},[1147,1907,1909],{"class":1149,"line":1908},36,[1147,1910,1221],{},[1147,1912,1914],{"class":1149,"line":1913},37,[1147,1915,1561],{},[1147,1917,1919],{"class":1149,"line":1918},38,[1147,1920,1239],{},[1147,1922,1924],{"class":1149,"line":1923},39,[1147,1925,1245],{},[1147,1927,1929],{"class":1149,"line":1928},40,[1147,1930,1252],{"emptyLinePlaceholder":1251},[1147,1932,1934],{"class":1149,"line":1933},41,[1147,1935,1578],{},[1147,1937,1939],{"class":1149,"line":1938},42,[1147,1940,1210],{},[1147,1942,1944],{"class":1149,"line":1943},43,[1147,1945,1587],{},[1147,1947,1949],{"class":1149,"line":1948},44,[1147,1950,1221],{},[1147,1952,1954],{"class":1149,"line":1953},45,[1147,1955,1596],{},[1147,1957,1959],{"class":1149,"line":1958},46,[1147,1960,1239],{},[1147,1962,1964],{"class":1149,"line":1963},47,[1147,1965,1245],{},[1085,1967,1968,1971,1972,1975,1976,1979],{},[1094,1969,1970],{},"activeAlerts"," is one ",[1094,1973,1974],{},"Alert[]"," array holding three different classes side by side, and ",[1094,1977,1978],{},"showAll"," never needs to know which is which.",[1080,1981,1983],{"id":1982},"what-it-prints","What It Prints",[1138,1985,1990],{"className":1986,"code":1988,"language":1989},[1987],"language-text","[ALERT] Battery low: 11.4V\n[ALERT] CAN device 12 not responding\n[ALERT] Camera disconnected\n","text",[1094,1991,1988],{"__ignoreMap":1143},[1085,1993,1994,1995,1998,1999,2001,2002,2004],{},"Adding a new kind of alert later (say, a ",[1094,1996,1997],{},"BrownoutAlert",") wouldn't require touching ",[1094,2000,1978],{}," at all — as long as the new class extends ",[1094,2003,1522],{},", the existing method already accepts it.",[1080,2006,2008],{"id":2007},"the-same-idea-with-an-arraylist","The Same Idea with an ArrayList",[1085,2010,1087,2011,2014,2015,2018],{},[1094,2012,2013],{},"ArrayList\u003CAlert>"," works the same way, if the alerts are collected one at a time while the robot checks itself (with ",[1094,2016,2017],{},"import java.util.ArrayList;"," at the top of the file, as in Ch.9):",[1138,2020,2022],{"className":1140,"code":2021,"language":1142,"meta":1143,"style":1143},"ArrayList\u003CAlert> alertList = new ArrayList\u003CAlert>();\nalertList.add(new BatteryAlert(11.4));\nalertList.add(new CanAlert(12));\n",[1094,2023,2024,2029,2034],{"__ignoreMap":1143},[1147,2025,2026],{"class":1149,"line":1150},[1147,2027,2028],{},"ArrayList\u003CAlert> alertList = new ArrayList\u003CAlert>();\n",[1147,2030,2031],{"class":1149,"line":1156},[1147,2032,2033],{},"alertList.add(new BatteryAlert(11.4));\n",[1147,2035,2036],{"class":1149,"line":1162},[1147,2037,2038],{},"alertList.add(new CanAlert(12));\n",[1085,2040,2041,2042,2045,2046,2048],{},"Both ",[1094,2043,2044],{},"add"," calls are legal for the same reason as the array: each object is an ",[1094,2047,1522],{},".",[1080,2050,2052],{"id":2051},"recap","Recap",[1328,2054,2055,2061,2072],{},[1331,2056,2057,2058,2060],{},"Two or more subclasses of one superclass form an inheritance hierarchy, with ",[1094,2059,1119],{}," at the top.",[1331,2062,2063,2064,2067,2068,2071],{},"A superclass-typed variable, array, or ",[1094,2065,2066],{},"ArrayList"," can hold objects of any subclass — ",[1094,2069,2070],{},"Alert first = new BatteryAlert(11.4);"," — but never the reverse.",[1331,2073,2074,2075,2078],{},"A method whose parameter is typed against the superclass (",[1094,2076,2077],{},"showAll(Alert[] alerts)",") works for every class in the hierarchy, including ones written later.",[1412,2080,1414],{},{"title":1143,"searchDepth":1156,"depth":1156,"links":2082},[2083,2084,2085,2086,2087,2088,2089,2090,2091],{"id":1438,"depth":1156,"text":1439},{"id":1445,"depth":1156,"text":1446},{"id":1526,"depth":1156,"text":1527},{"id":1622,"depth":1156,"text":1623},{"id":1664,"depth":1156,"text":1665},{"id":1730,"depth":1156,"text":1731},{"id":1982,"depth":1156,"text":1983},{"id":2007,"depth":1156,"text":2008},{"id":2051,"depth":1156,"text":2052},{"outlineRef":1425,"pairsWith":2093,"status":2094},"[`lessons\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies.md`](..\u002F..\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt)",{"title":651,"description":1143},"aPGyJpYL08U8MBgBCufgHRg5liV9APVOoPWeZyT6PQU",{"id":2098,"title":964,"body":2099,"description":1143,"extension":1423,"meta":3773,"navigation":1251,"path":963,"seo":3775,"stem":965,"__hash__":3776},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies.md",{"type":1073,"value":2100,"toc":3768},[2101,2104,2108,2114,2134,2141,2146,2176,2182,2207,2250,2254,2268,2405,2423,2491,2496,2673,2755,2759,2765,2772,2838,2851,2857,2862,3143,3148,3153,3159,3164,3169,3174,3178,3184,3188,3194,3199,3203,3209,3213,3219,3224,3228,3234,3238,3244,3249,3253,3259,3263,3269,3274,3717,3766],[1076,2102,964],{"id":2103},"inheritance-hierarchies-exercises",[1080,2105,2107],{"id":2106},"multiple-choice","Multiple Choice",[1085,2109,2110,2113],{},[1089,2111,2112],{},"Question:"," Given this small hierarchy:",[1138,2115,2117],{"className":1140,"code":2116,"language":1142,"meta":1143,"style":1143},"class Actuator { }\nclass Arm extends Actuator { }\nclass Wrist extends Actuator { }\n",[1094,2118,2119,2124,2129],{"__ignoreMap":1143},[1147,2120,2121],{"class":1149,"line":1150},[1147,2122,2123],{},"class Actuator { }\n",[1147,2125,2126],{"class":1149,"line":1156},[1147,2127,2128],{},"class Arm extends Actuator { }\n",[1147,2130,2131],{"class":1149,"line":1162},[1147,2132,2133],{},"class Wrist extends Actuator { }\n",[1085,2135,2136,2137,2140],{},"Which of these does ",[1089,2138,2139],{},"not"," compile?",[1085,2142,2143],{},[1089,2144,2145],{},"Options:",[1328,2147,2148,2154,2160,2166],{},[1331,2149,2150,2151],{},"A. ",[1094,2152,2153],{},"Actuator m = new Arm();",[1331,2155,2156,2157],{},"B. ",[1094,2158,2159],{},"Wrist w = new Actuator();",[1331,2161,2162,2163],{},"C. ",[1094,2164,2165],{},"Actuator[] parts = { new Arm(), new Wrist() };",[1331,2167,2168,2169,2172,2173],{},"D. ",[1094,2170,2171],{},"ArrayList\u003CActuator> list = new ArrayList\u003CActuator>();"," followed by ",[1094,2174,2175],{},"list.add(new Wrist());",[1085,2177,2178,2181],{},[1089,2179,2180],{},"Answer:"," B",[1085,2183,2184,2187,2188,2191,2192,2195,2196,2199,2200,2203,2204,2206],{},[1089,2185,2186],{},"Why:"," A subclass-typed variable can't hold a plain superclass object. ",[1094,2189,2190],{},"Wrist w"," promises that ",[1094,2193,2194],{},"w"," refers to a ",[1094,2197,2198],{},"Wrist",", but an ",[1094,2201,2202],{},"Actuator"," isn't necessarily a ",[1094,2205,2198],{}," — so the compiler rejects it. Assignments only work the other direction: superclass variable, subclass object.",[1328,2208,2209,2221,2238],{},[1331,2210,2211,2212,1343,2215,2217,2218,2220],{},"A is wrong — this compiles. An ",[1094,2213,2214],{},"Arm",[1094,2216,2202],{},", so an ",[1094,2219,2202],{}," variable can hold it.",[1331,2222,2223,2224,2227,2228,2230,2231,2233,2234,1343,2236,2048],{},"C is wrong — this compiles. An ",[1094,2225,2226],{},"Actuator[]"," array can hold any mix of ",[1094,2229,2202],{}," and its subclasses, because every ",[1094,2232,2214],{}," and every ",[1094,2235,2198],{},[1094,2237,2202],{},[1331,2239,2240,2241,2244,2245,2247,2248,2048],{},"D is wrong — this compiles too, for the same reason as C: an ",[1094,2242,2243],{},"ArrayList\u003CActuator>"," accepts any object that is an ",[1094,2246,2202],{},", including a ",[1094,2249,2198],{},[1080,2251,2253],{"id":2252},"micro-parsons","Micro-Parsons",[1085,2255,2256,2259,2260,2263,2264,2267],{},[1089,2257,2258],{},"Problem:"," An intake has two rollers, and both are kinds of ",[1094,2261,2262],{},"Roller",". Given these classes, which are already written and go ",[1122,2265,2266],{},"below"," the main class in the same file:",[1138,2269,2271],{"className":1140,"code":2270,"language":1142,"meta":1143,"style":1143},"class Roller\n{\n    private String name;\n\n    public Roller(String name)\n    {\n        this.name = name;\n    }\n\n    public void spin()\n    {\n        System.out.println(name + \" spinning\");\n    }\n}\n\nclass FloorRoller extends Roller\n{\n    public FloorRoller()\n    {\n        super(\"Floor roller\");\n    }\n}\n\nclass FeederRoller extends Roller\n{\n    public FeederRoller()\n    {\n        super(\"Feeder roller\");\n    }\n}\n",[1094,2272,2273,2278,2282,2287,2291,2296,2300,2305,2309,2313,2318,2322,2327,2331,2335,2339,2344,2348,2353,2357,2362,2366,2370,2374,2379,2383,2388,2392,2397,2401],{"__ignoreMap":1143},[1147,2274,2275],{"class":1149,"line":1150},[1147,2276,2277],{},"class Roller\n",[1147,2279,2280],{"class":1149,"line":1156},[1147,2281,1210],{},[1147,2283,2284],{"class":1149,"line":1162},[1147,2285,2286],{},"    private String name;\n",[1147,2288,2289],{"class":1149,"line":1218},[1147,2290,1252],{"emptyLinePlaceholder":1251},[1147,2292,2293],{"class":1149,"line":1224},[1147,2294,2295],{},"    public Roller(String name)\n",[1147,2297,2298],{"class":1149,"line":1230},[1147,2299,1221],{},[1147,2301,2302],{"class":1149,"line":1236},[1147,2303,2304],{},"        this.name = name;\n",[1147,2306,2307],{"class":1149,"line":1242},[1147,2308,1239],{},[1147,2310,2311],{"class":1149,"line":1248},[1147,2312,1252],{"emptyLinePlaceholder":1251},[1147,2314,2315],{"class":1149,"line":1255},[1147,2316,2317],{},"    public void spin()\n",[1147,2319,2320],{"class":1149,"line":1261},[1147,2321,1221],{},[1147,2323,2324],{"class":1149,"line":1503},[1147,2325,2326],{},"        System.out.println(name + \" spinning\");\n",[1147,2328,2329],{"class":1149,"line":1509},[1147,2330,1239],{},[1147,2332,2333],{"class":1149,"line":1514},[1147,2334,1245],{},[1147,2336,2337],{"class":1149,"line":1603},[1147,2338,1252],{"emptyLinePlaceholder":1251},[1147,2340,2341],{"class":1149,"line":1808},[1147,2342,2343],{},"class FloorRoller extends Roller\n",[1147,2345,2346],{"class":1149,"line":1813},[1147,2347,1210],{},[1147,2349,2350],{"class":1149,"line":1818},[1147,2351,2352],{},"    public FloorRoller()\n",[1147,2354,2355],{"class":1149,"line":1823},[1147,2356,1221],{},[1147,2358,2359],{"class":1149,"line":1828},[1147,2360,2361],{},"        super(\"Floor roller\");\n",[1147,2363,2364],{"class":1149,"line":1833},[1147,2365,1239],{},[1147,2367,2368],{"class":1149,"line":1838},[1147,2369,1245],{},[1147,2371,2372],{"class":1149,"line":1843},[1147,2373,1252],{"emptyLinePlaceholder":1251},[1147,2375,2376],{"class":1149,"line":1848},[1147,2377,2378],{},"class FeederRoller extends Roller\n",[1147,2380,2381],{"class":1149,"line":1853},[1147,2382,1210],{},[1147,2384,2385],{"class":1149,"line":1858},[1147,2386,2387],{},"    public FeederRoller()\n",[1147,2389,2390],{"class":1149,"line":1863},[1147,2391,1221],{},[1147,2393,2394],{"class":1149,"line":1868},[1147,2395,2396],{},"        super(\"Feeder roller\");\n",[1147,2398,2399],{"class":1149,"line":1873},[1147,2400,1239],{},[1147,2402,2403],{"class":1149,"line":1878},[1147,2404,1245],{},[1085,2406,2407,2408,2411,2412,2415,2416,2419,2420,1136],{},"Reorder the fragments below into the main class that goes above them. It should store both rollers in one ",[1094,2409,2410],{},"Roller[]"," array, then loop over the array and call ",[1094,2413,2414],{},"spin()"," on each one, printing ",[1094,2417,2418],{},"Floor roller spinning"," and then ",[1094,2421,2422],{},"Feeder roller spinning",[1328,2424,2425,2431,2437,2443,2449,2455,2461,2467,2473,2479,2485],{},[1331,2426,2427,2428],{},"a. ",[1094,2429,2430],{},"        for (Roller r : rollers)",[1331,2432,2433,2434],{},"b. ",[1094,2435,2436],{},"    }",[1331,2438,2439,2440],{},"c. ",[1094,2441,2442],{},"public class RollerCheck",[1331,2444,2445,2446],{},"d. ",[1094,2447,2448],{},"            r.spin();",[1331,2450,2451,2452],{},"e. ",[1094,2453,2454],{},"    {",[1331,2456,2457,2458],{},"f. ",[1094,2459,2460],{},"}",[1331,2462,2463,2464],{},"g. ",[1094,2465,2466],{},"        Roller[] rollers = { new FloorRoller(), new FeederRoller() };",[1331,2468,2469,2470],{},"h. ",[1094,2471,2472],{},"{",[1331,2474,2475,2476],{},"i. ",[1094,2477,2478],{},"        }",[1331,2480,2481,2482],{},"j. ",[1094,2483,2484],{},"    public static void main(String[] args)",[1331,2486,2487,2488],{},"k. ",[1094,2489,2490],{},"        {",[1085,2492,2493,2495],{},[1089,2494,2180],{}," c, h, j, e, g, a, k, d, i, b, f",[1138,2497,2499],{"className":1140,"code":2498,"language":1142,"meta":1143,"style":1143},"public class RollerCheck\n{\n    public static void main(String[] args)\n    {\n        Roller[] rollers = { new FloorRoller(), new FeederRoller() };\n        for (Roller r : rollers)\n        {\n            r.spin();\n        }\n    }\n}\n\nclass Roller\n{\n    private String name;\n\n    public Roller(String name)\n    {\n        this.name = name;\n    }\n\n    public void spin()\n    {\n        System.out.println(name + \" spinning\");\n    }\n}\n\nclass FloorRoller extends Roller\n{\n    public FloorRoller()\n    {\n        super(\"Floor roller\");\n    }\n}\n\nclass FeederRoller extends Roller\n{\n    public FeederRoller()\n    {\n        super(\"Feeder roller\");\n    }\n}\n",[1094,2500,2501,2506,2510,2514,2518,2523,2528,2532,2537,2541,2545,2549,2553,2557,2561,2565,2569,2573,2577,2581,2585,2589,2593,2597,2601,2605,2609,2613,2617,2621,2625,2629,2633,2637,2641,2645,2649,2653,2657,2661,2665,2669],{"__ignoreMap":1143},[1147,2502,2503],{"class":1149,"line":1150},[1147,2504,2505],{},"public class RollerCheck\n",[1147,2507,2508],{"class":1149,"line":1156},[1147,2509,1210],{},[1147,2511,2512],{"class":1149,"line":1162},[1147,2513,1787],{},[1147,2515,2516],{"class":1149,"line":1218},[1147,2517,1221],{},[1147,2519,2520],{"class":1149,"line":1224},[1147,2521,2522],{},"        Roller[] rollers = { new FloorRoller(), new FeederRoller() };\n",[1147,2524,2525],{"class":1149,"line":1230},[1147,2526,2527],{},"        for (Roller r : rollers)\n",[1147,2529,2530],{"class":1149,"line":1236},[1147,2531,1764],{},[1147,2533,2534],{"class":1149,"line":1242},[1147,2535,2536],{},"            r.spin();\n",[1147,2538,2539],{"class":1149,"line":1248},[1147,2540,1774],{},[1147,2542,2543],{"class":1149,"line":1255},[1147,2544,1239],{},[1147,2546,2547],{"class":1149,"line":1261},[1147,2548,1245],{},[1147,2550,2551],{"class":1149,"line":1503},[1147,2552,1252],{"emptyLinePlaceholder":1251},[1147,2554,2555],{"class":1149,"line":1509},[1147,2556,2277],{},[1147,2558,2559],{"class":1149,"line":1514},[1147,2560,1210],{},[1147,2562,2563],{"class":1149,"line":1603},[1147,2564,2286],{},[1147,2566,2567],{"class":1149,"line":1808},[1147,2568,1252],{"emptyLinePlaceholder":1251},[1147,2570,2571],{"class":1149,"line":1813},[1147,2572,2295],{},[1147,2574,2575],{"class":1149,"line":1818},[1147,2576,1221],{},[1147,2578,2579],{"class":1149,"line":1823},[1147,2580,2304],{},[1147,2582,2583],{"class":1149,"line":1828},[1147,2584,1239],{},[1147,2586,2587],{"class":1149,"line":1833},[1147,2588,1252],{"emptyLinePlaceholder":1251},[1147,2590,2591],{"class":1149,"line":1838},[1147,2592,2317],{},[1147,2594,2595],{"class":1149,"line":1843},[1147,2596,1221],{},[1147,2598,2599],{"class":1149,"line":1848},[1147,2600,2326],{},[1147,2602,2603],{"class":1149,"line":1853},[1147,2604,1239],{},[1147,2606,2607],{"class":1149,"line":1858},[1147,2608,1245],{},[1147,2610,2611],{"class":1149,"line":1863},[1147,2612,1252],{"emptyLinePlaceholder":1251},[1147,2614,2615],{"class":1149,"line":1868},[1147,2616,2343],{},[1147,2618,2619],{"class":1149,"line":1873},[1147,2620,1210],{},[1147,2622,2623],{"class":1149,"line":1878},[1147,2624,2352],{},[1147,2626,2627],{"class":1149,"line":1883},[1147,2628,1221],{},[1147,2630,2631],{"class":1149,"line":1888},[1147,2632,2361],{},[1147,2634,2635],{"class":1149,"line":1893},[1147,2636,1239],{},[1147,2638,2639],{"class":1149,"line":1898},[1147,2640,1245],{},[1147,2642,2643],{"class":1149,"line":1903},[1147,2644,1252],{"emptyLinePlaceholder":1251},[1147,2646,2647],{"class":1149,"line":1908},[1147,2648,2378],{},[1147,2650,2651],{"class":1149,"line":1913},[1147,2652,1210],{},[1147,2654,2655],{"class":1149,"line":1918},[1147,2656,2387],{},[1147,2658,2659],{"class":1149,"line":1923},[1147,2660,1221],{},[1147,2662,2663],{"class":1149,"line":1928},[1147,2664,2396],{},[1147,2666,2667],{"class":1149,"line":1933},[1147,2668,1239],{},[1147,2670,2671],{"class":1149,"line":1938},[1147,2672,1245],{},[1085,2674,2675,2678,2679,2682,2683,2686,2687,2690,2691,2682,2694,2697,2698,2701,2702,2704,2705,2707,2708,2711,2712,2715,2716,2719,2720,2690,2723,2726,2727,1714,2730,1101,2732,2734,2735,2737,2738,2740,2741,2744,2745,2690,2747,2750,2751,2754],{},[1089,2676,2677],{},"Why this order:"," The class line (",[1094,2680,2681],{},"c",") and its brace (",[1094,2684,2685],{},"h","), then ",[1094,2688,2689],{},"main"," (",[1094,2692,2693],{},"j",[1094,2695,2696],{},"e","). The array (",[1094,2699,2700],{},"g",") has to exist before the loop (",[1094,2703,1713],{},") can walk through it. It's typed ",[1094,2706,2410],{},", so it can hold a ",[1094,2709,2710],{},"FloorRoller"," and a ",[1094,2713,2714],{},"FeederRoller"," side by side. The loop's opening brace (",[1094,2717,2718],{},"k",") comes next, then its body, ",[1094,2721,2722],{},"r.spin();",[1094,2724,2725],{},"d","). ",[1094,2728,2729],{},"r",[1094,2731,2262],{},[1094,2733,2414],{}," is written in ",[1094,2736,2262],{},", so the call works for both objects: each subclass inherits ",[1094,2739,2414],{},". The braces then close in reverse order: the loop (",[1094,2742,2743],{},"i","), ",[1094,2746,2689],{},[1094,2748,2749],{},"b","), then the class (",[1094,2752,2753],{},"f",").",[1080,2756,2758],{"id":2757},"coding","Coding",[1085,2760,2761,2764],{},[1089,2762,2763],{},"Mode:"," full-program",[1085,2766,2767,1336,2769,2771],{},[1089,2768,2258],{},[1094,2770,1108],{}," (below, already written, and not to be changed) is the superclass of\nevery mechanism. Build a small hierarchy and a registry that manages all of it from one place:",[1328,2773,2774,2786],{},[1331,2775,2776,2777,1406,2779,1097,2781,1101,2783,2785],{},"Three subclasses of ",[1094,2778,1108],{},[1094,2780,1096],{},[1094,2782,1100],{},[1094,2784,1104],{},". Each one only needs a\nconstructor that takes the part's name and passes it up.",[1331,2787,2788,2791,2792,2794,2795,2798,2799],{},[1094,2789,2790],{},"PartRegistry",", which keeps its parts in one ",[1094,2793,2066],{}," typed against the ",[1089,2796,2797],{},"superclass",", so\nit can hold all three kinds. It needs three methods:\n",[1328,2800,2801,2807,2817],{},[1331,2802,2803,2806],{},[1094,2804,2805],{},"add(RobotPart part)"," stores a part.",[1331,2808,2809,2812,2813,2816],{},[1094,2810,2811],{},"stopAll()"," calls ",[1094,2814,2815],{},"stop()"," on every stored part, in the order they were added.",[1331,2818,2819,2822,2823,2826,2827,2830,2831,2833,2834,2837],{},[1094,2820,2821],{},"find(String name)"," returns the stored part whose ",[1094,2824,2825],{},"getName()"," equals ",[1094,2828,2829],{},"name",", as a\n",[1094,2832,1108],{},", or ",[1094,2835,2836],{},"null"," if there is none. (If two parts share a name, return the first.)",[1085,2839,2840,2841,2843,2844,2847,2848,1136],{},"The fixed ",[1094,2842,2689],{}," reads a part count, then one ",[1094,2845,2846],{},"kind name"," line per part, then a name to look up.\nFor the input ",[1094,2849,2850],{},"3 intake Front climber Left shooter Main Left",[1138,2852,2855],{"className":2853,"code":2854,"language":1989,"meta":1143},[1987],"[Front] stopped\n[Left] stopped\n[Main] stopped\nfound Left\n",[1094,2856,2854],{"__ignoreMap":1143},[1085,2858,2859],{},[1089,2860,2861],{},"Starter:",[1138,2863,2865],{"className":1140,"code":2864,"language":1142,"meta":1143,"style":1143},"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        PartRegistry registry = new PartRegistry();\n        int count = in.nextInt();\n        for (int i = 0; i \u003C count; i++)\n        {\n            String kind = in.next();\n            String name = in.next();\n            if (kind.equals(\"intake\"))\n            {\n                registry.add(new Intake(name));\n            }\n            else if (kind.equals(\"shooter\"))\n            {\n                registry.add(new Shooter(name));\n            }\n            else\n            {\n                registry.add(new Climber(name));\n            }\n        }\n        registry.stopAll();\n        String query = in.next();\n        RobotPart found = registry.find(query);\n        if (found == null)\n        {\n            System.out.println(\"no part named \" + query);\n        }\n        else\n        {\n            System.out.println(\"found \" + found.getName());\n        }\n    }\n}\n\n\u002F\u002F Don't change RobotPart\nclass RobotPart\n{\n    private String name;\n\n    public RobotPart(String name) { this.name = name; }\n    public String getName() { return name; }\n    public void log(String msg) { System.out.println(\"[\" + name + \"] \" + msg); }\n    public void stop() { log(\"stopped\"); }\n}\n\n\u002F\u002F TODO: Intake, Shooter, and Climber, each extending RobotPart\n\nclass PartRegistry\n{\n    \u002F\u002F TODO: an ArrayList of RobotPart, plus add(RobotPart), stopAll(), and find(String)\n}\n",[1094,2866,2867,2872,2876,2881,2885,2890,2894,2898,2903,2908,2913,2918,2922,2927,2932,2937,2942,2947,2952,2957,2961,2966,2970,2975,2979,2984,2988,2992,2997,3002,3007,3012,3016,3021,3025,3030,3034,3039,3043,3047,3051,3055,3060,3065,3069,3073,3077,3082,3088,3094,3100,3105,3110,3116,3121,3127,3132,3138],{"__ignoreMap":1143},[1147,2868,2869],{"class":1149,"line":1150},[1147,2870,2871],{},"import java.util.*;\n",[1147,2873,2874],{"class":1149,"line":1156},[1147,2875,1252],{"emptyLinePlaceholder":1251},[1147,2877,2878],{"class":1149,"line":1162},[1147,2879,2880],{},"public class Main\n",[1147,2882,2883],{"class":1149,"line":1218},[1147,2884,1210],{},[1147,2886,2887],{"class":1149,"line":1224},[1147,2888,2889],{},"    \u002F\u002F Don't change main\n",[1147,2891,2892],{"class":1149,"line":1230},[1147,2893,1787],{},[1147,2895,2896],{"class":1149,"line":1236},[1147,2897,1221],{},[1147,2899,2900],{"class":1149,"line":1242},[1147,2901,2902],{},"        Scanner in = new Scanner(System.in);\n",[1147,2904,2905],{"class":1149,"line":1248},[1147,2906,2907],{},"        PartRegistry registry = new PartRegistry();\n",[1147,2909,2910],{"class":1149,"line":1255},[1147,2911,2912],{},"        int count = in.nextInt();\n",[1147,2914,2915],{"class":1149,"line":1261},[1147,2916,2917],{},"        for (int i = 0; i \u003C count; i++)\n",[1147,2919,2920],{"class":1149,"line":1503},[1147,2921,1764],{},[1147,2923,2924],{"class":1149,"line":1509},[1147,2925,2926],{},"            String kind = in.next();\n",[1147,2928,2929],{"class":1149,"line":1514},[1147,2930,2931],{},"            String name = in.next();\n",[1147,2933,2934],{"class":1149,"line":1603},[1147,2935,2936],{},"            if (kind.equals(\"intake\"))\n",[1147,2938,2939],{"class":1149,"line":1808},[1147,2940,2941],{},"            {\n",[1147,2943,2944],{"class":1149,"line":1813},[1147,2945,2946],{},"                registry.add(new Intake(name));\n",[1147,2948,2949],{"class":1149,"line":1818},[1147,2950,2951],{},"            }\n",[1147,2953,2954],{"class":1149,"line":1823},[1147,2955,2956],{},"            else if (kind.equals(\"shooter\"))\n",[1147,2958,2959],{"class":1149,"line":1828},[1147,2960,2941],{},[1147,2962,2963],{"class":1149,"line":1833},[1147,2964,2965],{},"                registry.add(new Shooter(name));\n",[1147,2967,2968],{"class":1149,"line":1838},[1147,2969,2951],{},[1147,2971,2972],{"class":1149,"line":1843},[1147,2973,2974],{},"            else\n",[1147,2976,2977],{"class":1149,"line":1848},[1147,2978,2941],{},[1147,2980,2981],{"class":1149,"line":1853},[1147,2982,2983],{},"                registry.add(new Climber(name));\n",[1147,2985,2986],{"class":1149,"line":1858},[1147,2987,2951],{},[1147,2989,2990],{"class":1149,"line":1863},[1147,2991,1774],{},[1147,2993,2994],{"class":1149,"line":1868},[1147,2995,2996],{},"        registry.stopAll();\n",[1147,2998,2999],{"class":1149,"line":1873},[1147,3000,3001],{},"        String query = in.next();\n",[1147,3003,3004],{"class":1149,"line":1878},[1147,3005,3006],{},"        RobotPart found = registry.find(query);\n",[1147,3008,3009],{"class":1149,"line":1883},[1147,3010,3011],{},"        if (found == null)\n",[1147,3013,3014],{"class":1149,"line":1888},[1147,3015,1764],{},[1147,3017,3018],{"class":1149,"line":1893},[1147,3019,3020],{},"            System.out.println(\"no part named \" + query);\n",[1147,3022,3023],{"class":1149,"line":1898},[1147,3024,1774],{},[1147,3026,3027],{"class":1149,"line":1903},[1147,3028,3029],{},"        else\n",[1147,3031,3032],{"class":1149,"line":1908},[1147,3033,1764],{},[1147,3035,3036],{"class":1149,"line":1913},[1147,3037,3038],{},"            System.out.println(\"found \" + found.getName());\n",[1147,3040,3041],{"class":1149,"line":1918},[1147,3042,1774],{},[1147,3044,3045],{"class":1149,"line":1923},[1147,3046,1239],{},[1147,3048,3049],{"class":1149,"line":1928},[1147,3050,1245],{},[1147,3052,3053],{"class":1149,"line":1933},[1147,3054,1252],{"emptyLinePlaceholder":1251},[1147,3056,3057],{"class":1149,"line":1938},[1147,3058,3059],{},"\u002F\u002F Don't change RobotPart\n",[1147,3061,3062],{"class":1149,"line":1943},[1147,3063,3064],{},"class RobotPart\n",[1147,3066,3067],{"class":1149,"line":1948},[1147,3068,1210],{},[1147,3070,3071],{"class":1149,"line":1953},[1147,3072,2286],{},[1147,3074,3075],{"class":1149,"line":1958},[1147,3076,1252],{"emptyLinePlaceholder":1251},[1147,3078,3079],{"class":1149,"line":1963},[1147,3080,3081],{},"    public RobotPart(String name) { this.name = name; }\n",[1147,3083,3085],{"class":1149,"line":3084},48,[1147,3086,3087],{},"    public String getName() { return name; }\n",[1147,3089,3091],{"class":1149,"line":3090},49,[1147,3092,3093],{},"    public void log(String msg) { System.out.println(\"[\" + name + \"] \" + msg); }\n",[1147,3095,3097],{"class":1149,"line":3096},50,[1147,3098,3099],{},"    public void stop() { log(\"stopped\"); }\n",[1147,3101,3103],{"class":1149,"line":3102},51,[1147,3104,1245],{},[1147,3106,3108],{"class":1149,"line":3107},52,[1147,3109,1252],{"emptyLinePlaceholder":1251},[1147,3111,3113],{"class":1149,"line":3112},53,[1147,3114,3115],{},"\u002F\u002F TODO: Intake, Shooter, and Climber, each extending RobotPart\n",[1147,3117,3119],{"class":1149,"line":3118},54,[1147,3120,1252],{"emptyLinePlaceholder":1251},[1147,3122,3124],{"class":1149,"line":3123},55,[1147,3125,3126],{},"class PartRegistry\n",[1147,3128,3130],{"class":1149,"line":3129},56,[1147,3131,1210],{},[1147,3133,3135],{"class":1149,"line":3134},57,[1147,3136,3137],{},"    \u002F\u002F TODO: an ArrayList of RobotPart, plus add(RobotPart), stopAll(), and find(String)\n",[1147,3139,3141],{"class":1149,"line":3140},58,[1147,3142,1245],{},[1085,3144,3145],{},[1089,3146,3147],{},"Scenario 1 (visible):",[1085,3149,3150],{},[1089,3151,3152],{},"Input:",[1138,3154,3157],{"className":3155,"code":3156,"language":1989,"meta":1143},[1987],"3 intake Front climber Left shooter Main Left\n",[1094,3158,3156],{"__ignoreMap":1143},[1085,3160,3161],{},[1089,3162,3163],{},"Expected output:",[1138,3165,3167],{"className":3166,"code":2854,"language":1989,"meta":1143},[1987],[1094,3168,2854],{"__ignoreMap":1143},[1085,3170,3171],{},[1089,3172,3173],{},"Scenario 2 (visible):",[1085,3175,3176],{},[1089,3177,3152],{},[1138,3179,3182],{"className":3180,"code":3181,"language":1989,"meta":1143},[1987],"2 shooter Top intake Floor Wrist\n",[1094,3183,3181],{"__ignoreMap":1143},[1085,3185,3186],{},[1089,3187,3163],{},[1138,3189,3192],{"className":3190,"code":3191,"language":1989,"meta":1143},[1987],"[Top] stopped\n[Floor] stopped\nno part named Wrist\n",[1094,3193,3191],{"__ignoreMap":1143},[1085,3195,3196],{},[1089,3197,3198],{},"Scenario 3 (hidden):",[1085,3200,3201],{},[1089,3202,3152],{},[1138,3204,3207],{"className":3205,"code":3206,"language":1989,"meta":1143},[1987],"1 climber Hook Hook\n",[1094,3208,3206],{"__ignoreMap":1143},[1085,3210,3211],{},[1089,3212,3163],{},[1138,3214,3217],{"className":3215,"code":3216,"language":1989,"meta":1143},[1987],"[Hook] stopped\nfound Hook\n",[1094,3218,3216],{"__ignoreMap":1143},[1085,3220,3221],{},[1089,3222,3223],{},"Scenario 4 (hidden):",[1085,3225,3226],{},[1089,3227,3152],{},[1138,3229,3232],{"className":3230,"code":3231,"language":1989,"meta":1143},[1987],"4 intake A shooter B climber C intake D D\n",[1094,3233,3231],{"__ignoreMap":1143},[1085,3235,3236],{},[1089,3237,3163],{},[1138,3239,3242],{"className":3240,"code":3241,"language":1989,"meta":1143},[1987],"[A] stopped\n[B] stopped\n[C] stopped\n[D] stopped\nfound D\n",[1094,3243,3241],{"__ignoreMap":1143},[1085,3245,3246],{},[1089,3247,3248],{},"Scenario 5 (hidden):",[1085,3250,3251],{},[1089,3252,3152],{},[1138,3254,3257],{"className":3255,"code":3256,"language":1989,"meta":1143},[1987],"3 shooter Main climber Main intake Spare Spare\n",[1094,3258,3256],{"__ignoreMap":1143},[1085,3260,3261],{},[1089,3262,3163],{},[1138,3264,3267],{"className":3265,"code":3266,"language":1989,"meta":1143},[1987],"[Main] stopped\n[Main] stopped\n[Spare] stopped\nfound Spare\n",[1094,3268,3266],{"__ignoreMap":1143},[1085,3270,3271],{},[1089,3272,3273],{},"Solution:",[1138,3275,3277],{"className":1140,"code":3276,"language":1142,"meta":1143,"style":1143},"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        PartRegistry registry = new PartRegistry();\n        int count = in.nextInt();\n        for (int i = 0; i \u003C count; i++)\n        {\n            String kind = in.next();\n            String name = in.next();\n            if (kind.equals(\"intake\"))\n            {\n                registry.add(new Intake(name));\n            }\n            else if (kind.equals(\"shooter\"))\n            {\n                registry.add(new Shooter(name));\n            }\n            else\n            {\n                registry.add(new Climber(name));\n            }\n        }\n        registry.stopAll();\n        String query = in.next();\n        RobotPart found = registry.find(query);\n        if (found == null)\n        {\n            System.out.println(\"no part named \" + query);\n        }\n        else\n        {\n            System.out.println(\"found \" + found.getName());\n        }\n    }\n}\n\n\u002F\u002F Don't change RobotPart\nclass RobotPart\n{\n    private String name;\n\n    public RobotPart(String name) { this.name = name; }\n    public String getName() { return name; }\n    public void log(String msg) { System.out.println(\"[\" + name + \"] \" + msg); }\n    public void stop() { log(\"stopped\"); }\n}\n\nclass Intake extends RobotPart\n{\n    public Intake(String name) { super(name); }\n}\n\nclass Shooter extends RobotPart\n{\n    public Shooter(String name) { super(name); }\n}\n\nclass Climber extends RobotPart\n{\n    public Climber(String name) { super(name); }\n}\n\nclass PartRegistry\n{\n    private ArrayList\u003CRobotPart> parts = new ArrayList\u003CRobotPart>();\n\n    public void add(RobotPart part)\n    {\n        parts.add(part);\n    }\n\n    public void stopAll()\n    {\n        for (RobotPart p : parts)\n        {\n            p.stop();\n        }\n    }\n\n    public RobotPart find(String name)\n    {\n        for (RobotPart p : parts)\n        {\n            if (p.getName().equals(name))\n            {\n                return p;\n            }\n        }\n        return null;\n    }\n}\n",[1094,3278,3279,3283,3287,3291,3295,3299,3303,3307,3311,3315,3319,3323,3327,3331,3335,3339,3343,3347,3351,3355,3359,3363,3367,3371,3375,3379,3383,3387,3391,3395,3399,3403,3407,3411,3415,3419,3423,3427,3431,3435,3439,3443,3447,3451,3455,3459,3463,3467,3471,3475,3479,3483,3487,3492,3496,3501,3505,3509,3514,3519,3525,3530,3535,3541,3546,3552,3557,3562,3567,3572,3578,3583,3589,3594,3600,3605,3610,3616,3621,3627,3632,3638,3643,3648,3653,3659,3664,3669,3674,3680,3685,3691,3696,3701,3707,3712],{"__ignoreMap":1143},[1147,3280,3281],{"class":1149,"line":1150},[1147,3282,2871],{},[1147,3284,3285],{"class":1149,"line":1156},[1147,3286,1252],{"emptyLinePlaceholder":1251},[1147,3288,3289],{"class":1149,"line":1162},[1147,3290,2880],{},[1147,3292,3293],{"class":1149,"line":1218},[1147,3294,1210],{},[1147,3296,3297],{"class":1149,"line":1224},[1147,3298,2889],{},[1147,3300,3301],{"class":1149,"line":1230},[1147,3302,1787],{},[1147,3304,3305],{"class":1149,"line":1236},[1147,3306,1221],{},[1147,3308,3309],{"class":1149,"line":1242},[1147,3310,2902],{},[1147,3312,3313],{"class":1149,"line":1248},[1147,3314,2907],{},[1147,3316,3317],{"class":1149,"line":1255},[1147,3318,2912],{},[1147,3320,3321],{"class":1149,"line":1261},[1147,3322,2917],{},[1147,3324,3325],{"class":1149,"line":1503},[1147,3326,1764],{},[1147,3328,3329],{"class":1149,"line":1509},[1147,3330,2926],{},[1147,3332,3333],{"class":1149,"line":1514},[1147,3334,2931],{},[1147,3336,3337],{"class":1149,"line":1603},[1147,3338,2936],{},[1147,3340,3341],{"class":1149,"line":1808},[1147,3342,2941],{},[1147,3344,3345],{"class":1149,"line":1813},[1147,3346,2946],{},[1147,3348,3349],{"class":1149,"line":1818},[1147,3350,2951],{},[1147,3352,3353],{"class":1149,"line":1823},[1147,3354,2956],{},[1147,3356,3357],{"class":1149,"line":1828},[1147,3358,2941],{},[1147,3360,3361],{"class":1149,"line":1833},[1147,3362,2965],{},[1147,3364,3365],{"class":1149,"line":1838},[1147,3366,2951],{},[1147,3368,3369],{"class":1149,"line":1843},[1147,3370,2974],{},[1147,3372,3373],{"class":1149,"line":1848},[1147,3374,2941],{},[1147,3376,3377],{"class":1149,"line":1853},[1147,3378,2983],{},[1147,3380,3381],{"class":1149,"line":1858},[1147,3382,2951],{},[1147,3384,3385],{"class":1149,"line":1863},[1147,3386,1774],{},[1147,3388,3389],{"class":1149,"line":1868},[1147,3390,2996],{},[1147,3392,3393],{"class":1149,"line":1873},[1147,3394,3001],{},[1147,3396,3397],{"class":1149,"line":1878},[1147,3398,3006],{},[1147,3400,3401],{"class":1149,"line":1883},[1147,3402,3011],{},[1147,3404,3405],{"class":1149,"line":1888},[1147,3406,1764],{},[1147,3408,3409],{"class":1149,"line":1893},[1147,3410,3020],{},[1147,3412,3413],{"class":1149,"line":1898},[1147,3414,1774],{},[1147,3416,3417],{"class":1149,"line":1903},[1147,3418,3029],{},[1147,3420,3421],{"class":1149,"line":1908},[1147,3422,1764],{},[1147,3424,3425],{"class":1149,"line":1913},[1147,3426,3038],{},[1147,3428,3429],{"class":1149,"line":1918},[1147,3430,1774],{},[1147,3432,3433],{"class":1149,"line":1923},[1147,3434,1239],{},[1147,3436,3437],{"class":1149,"line":1928},[1147,3438,1245],{},[1147,3440,3441],{"class":1149,"line":1933},[1147,3442,1252],{"emptyLinePlaceholder":1251},[1147,3444,3445],{"class":1149,"line":1938},[1147,3446,3059],{},[1147,3448,3449],{"class":1149,"line":1943},[1147,3450,3064],{},[1147,3452,3453],{"class":1149,"line":1948},[1147,3454,1210],{},[1147,3456,3457],{"class":1149,"line":1953},[1147,3458,2286],{},[1147,3460,3461],{"class":1149,"line":1958},[1147,3462,1252],{"emptyLinePlaceholder":1251},[1147,3464,3465],{"class":1149,"line":1963},[1147,3466,3081],{},[1147,3468,3469],{"class":1149,"line":3084},[1147,3470,3087],{},[1147,3472,3473],{"class":1149,"line":3090},[1147,3474,3093],{},[1147,3476,3477],{"class":1149,"line":3096},[1147,3478,3099],{},[1147,3480,3481],{"class":1149,"line":3102},[1147,3482,1245],{},[1147,3484,3485],{"class":1149,"line":3107},[1147,3486,1252],{"emptyLinePlaceholder":1251},[1147,3488,3489],{"class":1149,"line":3112},[1147,3490,3491],{},"class Intake extends RobotPart\n",[1147,3493,3494],{"class":1149,"line":3118},[1147,3495,1210],{},[1147,3497,3498],{"class":1149,"line":3123},[1147,3499,3500],{},"    public Intake(String name) { super(name); }\n",[1147,3502,3503],{"class":1149,"line":3129},[1147,3504,1245],{},[1147,3506,3507],{"class":1149,"line":3134},[1147,3508,1252],{"emptyLinePlaceholder":1251},[1147,3510,3511],{"class":1149,"line":3140},[1147,3512,3513],{},"class Shooter extends RobotPart\n",[1147,3515,3517],{"class":1149,"line":3516},59,[1147,3518,1210],{},[1147,3520,3522],{"class":1149,"line":3521},60,[1147,3523,3524],{},"    public Shooter(String name) { super(name); }\n",[1147,3526,3528],{"class":1149,"line":3527},61,[1147,3529,1245],{},[1147,3531,3533],{"class":1149,"line":3532},62,[1147,3534,1252],{"emptyLinePlaceholder":1251},[1147,3536,3538],{"class":1149,"line":3537},63,[1147,3539,3540],{},"class Climber extends RobotPart\n",[1147,3542,3544],{"class":1149,"line":3543},64,[1147,3545,1210],{},[1147,3547,3549],{"class":1149,"line":3548},65,[1147,3550,3551],{},"    public Climber(String name) { super(name); }\n",[1147,3553,3555],{"class":1149,"line":3554},66,[1147,3556,1245],{},[1147,3558,3560],{"class":1149,"line":3559},67,[1147,3561,1252],{"emptyLinePlaceholder":1251},[1147,3563,3565],{"class":1149,"line":3564},68,[1147,3566,3126],{},[1147,3568,3570],{"class":1149,"line":3569},69,[1147,3571,1210],{},[1147,3573,3575],{"class":1149,"line":3574},70,[1147,3576,3577],{},"    private ArrayList\u003CRobotPart> parts = new ArrayList\u003CRobotPart>();\n",[1147,3579,3581],{"class":1149,"line":3580},71,[1147,3582,1252],{"emptyLinePlaceholder":1251},[1147,3584,3586],{"class":1149,"line":3585},72,[1147,3587,3588],{},"    public void add(RobotPart part)\n",[1147,3590,3592],{"class":1149,"line":3591},73,[1147,3593,1221],{},[1147,3595,3597],{"class":1149,"line":3596},74,[1147,3598,3599],{},"        parts.add(part);\n",[1147,3601,3603],{"class":1149,"line":3602},75,[1147,3604,1239],{},[1147,3606,3608],{"class":1149,"line":3607},76,[1147,3609,1252],{"emptyLinePlaceholder":1251},[1147,3611,3613],{"class":1149,"line":3612},77,[1147,3614,3615],{},"    public void stopAll()\n",[1147,3617,3619],{"class":1149,"line":3618},78,[1147,3620,1221],{},[1147,3622,3624],{"class":1149,"line":3623},79,[1147,3625,3626],{},"        for (RobotPart p : parts)\n",[1147,3628,3630],{"class":1149,"line":3629},80,[1147,3631,1764],{},[1147,3633,3635],{"class":1149,"line":3634},81,[1147,3636,3637],{},"            p.stop();\n",[1147,3639,3641],{"class":1149,"line":3640},82,[1147,3642,1774],{},[1147,3644,3646],{"class":1149,"line":3645},83,[1147,3647,1239],{},[1147,3649,3651],{"class":1149,"line":3650},84,[1147,3652,1252],{"emptyLinePlaceholder":1251},[1147,3654,3656],{"class":1149,"line":3655},85,[1147,3657,3658],{},"    public RobotPart find(String name)\n",[1147,3660,3662],{"class":1149,"line":3661},86,[1147,3663,1221],{},[1147,3665,3667],{"class":1149,"line":3666},87,[1147,3668,3626],{},[1147,3670,3672],{"class":1149,"line":3671},88,[1147,3673,1764],{},[1147,3675,3677],{"class":1149,"line":3676},89,[1147,3678,3679],{},"            if (p.getName().equals(name))\n",[1147,3681,3683],{"class":1149,"line":3682},90,[1147,3684,2941],{},[1147,3686,3688],{"class":1149,"line":3687},91,[1147,3689,3690],{},"                return p;\n",[1147,3692,3694],{"class":1149,"line":3693},92,[1147,3695,2951],{},[1147,3697,3699],{"class":1149,"line":3698},93,[1147,3700,1774],{},[1147,3702,3704],{"class":1149,"line":3703},94,[1147,3705,3706],{},"        return null;\n",[1147,3708,3710],{"class":1149,"line":3709},95,[1147,3711,1239],{},[1147,3713,3715],{"class":1149,"line":3714},96,[1147,3716,1245],{},[1085,3718,3719,3721,3722,3724,3725,3727,3728,3730,3731,3733,3734,3737,3738,3740,3741,3743,3744,3747,3748,3750,3751,3754,3755,3758,3759,3762,3763,3765],{},[1089,3720,2186],{}," Typing the list as ",[1094,3723,1270],{}," is what lets one registry hold an ",[1094,3726,1096],{},", a\n",[1094,3729,1100],{},", and a ",[1094,3732,1104],{}," side by side; an ",[1094,3735,3736],{},"ArrayList\u003CIntake>"," would reject the other two.\n",[1094,3739,2044],{},"'s parameter is also ",[1094,3742,1108],{},", so any subclass object is accepted, and ",[1094,3745,3746],{},"find"," returns a\n",[1094,3749,1108],{}," for the same reason. Comparing names uses ",[1094,3752,3753],{},".equals","; ",[1094,3756,3757],{},"=="," would compare references, and\nthe name read from the input is never the same ",[1094,3760,3761],{},"String"," object as the one stored in a part, so\n",[1094,3764,3746],{}," would never succeed.",[1412,3767,1414],{},{"title":1143,"searchDepth":1156,"depth":1156,"links":3769},[3770,3771,3772],{"id":2106,"depth":1156,"text":2107},{"id":2252,"depth":1156,"text":2253},{"id":2757,"depth":1156,"text":2758},{"outlineRef":1425,"pairsWith":2093,"status":3774},"new — authored exercises (Multiple Choice + Micro-Parsons + Coding)",{"title":964,"description":1143},"QqN5AcbpOIGJvjDxoqjzsyEaQoLOXREjQUzmv0bvKLI",1792718166119]