[{"data":1,"prerenderedAt":4078},["ShallowReactive",2],{"item-lessons-light-ch18-polymorphism-many-forms":3,"item-examples-light-ch18-polymorphism-many-forms":444,"item-exercises-light-ch18-polymorphism-many-forms":753,"item-lesson-full-ch18-polymorphism-many-forms-18.3":1070,"item-example-full-ch18-polymorphism-many-forms-18.3":1672,"item-exercise-full-ch18-polymorphism-many-forms-18.3":2321},[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":238,"body":1072,"description":1118,"extension":1665,"meta":1666,"navigation":1669,"path":237,"seo":1670,"stem":239,"__hash__":1671},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism.md",{"type":1073,"value":1074,"toc":1656},"minimark",[1075,1079,1084,1112,1153,1157,1172,1192,1199,1219,1247,1251,1262,1287,1313,1341,1345,1378,1406,1421,1441,1450,1470,1496,1519,1522,1526,1533,1537,1593,1597,1634,1652],[1076,1077,238],"h1",{"id":1078},"polymorphism",[1080,1081,1083],"h2",{"id":1082},"many-forms-one-piece-of-code","Many Forms, One Piece of Code",[1085,1086,1087,1090,1091,1095,1096,1100,1101,1104,1105,1107,1108,1111],"p",{},[1088,1089,238],"strong",{}," (\"many forms\") means the method that actually runs at runtime depends on the object's ",[1092,1093,1094],"em",{},"actual"," type — not the type its variable was declared with. This is the concrete payoff of everything Ch.17 and Lessons 18.1-18.2 built toward. Real WPILib code relies on it constantly: WPILib's ",[1097,1098,1099],"code",{},"MotorController"," type (in ",[1097,1102,1103],{},"org.wpilib.hardware.motor",") describes what every motor controller can do, and code written against it calls the same method on any motor controller without caring which class it actually is. (",[1097,1106,1099],{}," is an ",[1092,1109,1110],{},"interface",", a kind of type Ch.19 covers in full — for now, treat it like a superclass shared by every WPILib motor controller class.)",[1113,1114,1119],"pre",{"className":1115,"code":1116,"language":1117,"meta":1118,"style":1118},"language-java shiki shiki-themes github-light github-dark","public void driveForward(MotorController controller)\n{\n    \u002F\u002F works the same whichever motor controller class is passed in\n    controller.setThrottle(0.5);\n}\n","java","",[1097,1120,1121,1129,1135,1141,1147],{"__ignoreMap":1118},[1122,1123,1126],"span",{"class":1124,"line":1125},"line",1,[1122,1127,1128],{},"public void driveForward(MotorController controller)\n",[1122,1130,1132],{"class":1124,"line":1131},2,[1122,1133,1134],{},"{\n",[1122,1136,1138],{"class":1124,"line":1137},3,[1122,1139,1140],{},"    \u002F\u002F works the same whichever motor controller class is passed in\n",[1122,1142,1144],{"class":1124,"line":1143},4,[1122,1145,1146],{},"    controller.setThrottle(0.5);\n",[1122,1148,1150],{"class":1124,"line":1149},5,[1122,1151,1152],{},"}\n",[1080,1154,1156],{"id":1155},"declared-type-vs-actual-type","Declared Type vs. Actual Type",[1085,1158,1159,1160,1163,1164,1167,1168,1171],{},"Every variable has two types that matter: its ",[1088,1161,1162],{},"declared (compile-time) type"," — what it's written as in the code — and its ",[1088,1165,1166],{},"actual (runtime) type"," — the real class that was actually constructed with ",[1097,1169,1170],{},"new",":",[1113,1173,1175],{"className":1115,"code":1174,"language":1117,"meta":1118,"style":1118},"RobotPart part = new Intake(\"Front Intake\");\n\u002F\u002F declared type: RobotPart\n\u002F\u002F actual type:   Intake\n",[1097,1176,1177,1182,1187],{"__ignoreMap":1118},[1122,1178,1179],{"class":1124,"line":1125},[1122,1180,1181],{},"RobotPart part = new Intake(\"Front Intake\");\n",[1122,1183,1184],{"class":1124,"line":1131},[1122,1185,1186],{},"\u002F\u002F declared type: RobotPart\n",[1122,1188,1189],{"class":1124,"line":1137},[1122,1190,1191],{},"\u002F\u002F actual type:   Intake\n",[1085,1193,1194,1195,1198],{},"The compiler only ever checks the ",[1088,1196,1197],{},"declared"," type when deciding whether code compiles — it verifies that whatever method you're calling actually exists on that declared type (or an ancestor of it):",[1113,1200,1202],{"className":1115,"code":1201,"language":1117,"meta":1118,"style":1118},"Object message = new String(\"hi\");\n\u002F\u002F COMPILE ERROR — Object has no indexOf method, even though String does\nmessage.indexOf(\"h\");\n",[1097,1203,1204,1209,1214],{"__ignoreMap":1118},[1122,1205,1206],{"class":1124,"line":1125},[1122,1207,1208],{},"Object message = new String(\"hi\");\n",[1122,1210,1211],{"class":1124,"line":1131},[1122,1212,1213],{},"\u002F\u002F COMPILE ERROR — Object has no indexOf method, even though String does\n",[1122,1215,1216],{"class":1124,"line":1137},[1122,1217,1218],{},"message.indexOf(\"h\");\n",[1085,1220,1221,1222,1225,1226,1229,1230,1233,1234,1236,1237,1240,1241,1243,1244,1246],{},"Even though the real object here is a ",[1097,1223,1224],{},"String"," (which absolutely does have ",[1097,1227,1228],{},"indexOf","), the compiler only looks at ",[1097,1231,1232],{},"message","'s ",[1092,1235,1197],{}," type, ",[1097,1238,1239],{},"Object"," — and refuses to compile, since ",[1097,1242,1239],{}," never promises an ",[1097,1245,1228],{}," method.",[1080,1248,1250],{"id":1249},"runtime-dispatch-the-actual-type-decides-which-version-runs","Runtime Dispatch: The Actual Type Decides Which Version Runs",[1085,1252,1253,1254,1257,1258,1261],{},"Once code ",[1092,1255,1256],{},"does"," compile, the JVM decides which overridden version of a method actually executes by looking at the object's real, actual type — starting there and searching upward through its superclasses if needed (same lookup process as Lesson 18.2's ",[1097,1259,1260],{},"super","):",[1113,1263,1265],{"className":1115,"code":1264,"language":1117,"meta":1118,"style":1118},"RobotPart part = new Intake(\"Front Intake\");  \u002F\u002F declared RobotPart, actually an Intake\n\u002F\u002F the compiler only confirms RobotPart HAS a stop() method —\n\u002F\u002F but Intake's own override (Lesson 18.1) is what actually runs\npart.stop();\n",[1097,1266,1267,1272,1277,1282],{"__ignoreMap":1118},[1122,1268,1269],{"class":1124,"line":1125},[1122,1270,1271],{},"RobotPart part = new Intake(\"Front Intake\");  \u002F\u002F declared RobotPart, actually an Intake\n",[1122,1273,1274],{"class":1124,"line":1131},[1122,1275,1276],{},"\u002F\u002F the compiler only confirms RobotPart HAS a stop() method —\n",[1122,1278,1279],{"class":1124,"line":1137},[1122,1280,1281],{},"\u002F\u002F but Intake's own override (Lesson 18.1) is what actually runs\n",[1122,1283,1284],{"class":1124,"line":1143},[1122,1285,1286],{},"part.stop();\n",[1085,1288,1289,1290,1293,1294,1297,1298,1301,1302,1305,1306,1293,1309,1312],{},"This is exactly what makes the earlier ",[1097,1291,1292],{},"RobotPart[]","\u002F",[1097,1295,1296],{},"ArrayList\u003CRobotPart>"," examples (Lesson 17.3) genuinely useful — a single loop calling ",[1097,1299,1300],{},"p.stop()"," on each element automatically runs whichever subclass's own ",[1097,1303,1304],{},"stop()"," actually applies, without an ",[1097,1307,1308],{},"if",[1097,1310,1311],{},"else"," chain checking each one's specific type:",[1113,1314,1316],{"className":1115,"code":1315,"language":1117,"meta":1118,"style":1118},"for (RobotPart p : allParts)\n{\n    \u002F\u002F Intake's stop(), Climber's stop(), Shooter's stop() — whichever fits each object\n    p.stop();\n}\n",[1097,1317,1318,1323,1327,1332,1337],{"__ignoreMap":1118},[1122,1319,1320],{"class":1124,"line":1125},[1122,1321,1322],{},"for (RobotPart p : allParts)\n",[1122,1324,1325],{"class":1124,"line":1131},[1122,1326,1134],{},[1122,1328,1329],{"class":1124,"line":1137},[1122,1330,1331],{},"    \u002F\u002F Intake's stop(), Climber's stop(), Shooter's stop() — whichever fits each object\n",[1122,1333,1334],{"class":1124,"line":1143},[1122,1335,1336],{},"    p.stop();\n",[1122,1338,1339],{"class":1124,"line":1149},[1122,1340,1152],{},[1080,1342,1344],{"id":1343},"casting-back-down","Casting Back Down",[1085,1346,1347,1348,1351,1352,1355,1356,1359,1360,1362,1363,1365,1366,1369,1370,1107,1372,1374,1375,1377],{},"Storing an ",[1097,1349,1350],{},"Intake"," in a ",[1097,1353,1354],{},"RobotPart"," variable is an ",[1088,1357,1358],{},"upcast"," — from a subclass type up to a superclass type — and it happens automatically, because every ",[1097,1361,1350],{}," is a ",[1097,1364,1354],{},". Going the other way, a ",[1088,1367,1368],{},"downcast",", needs an explicit cast, because not every ",[1097,1371,1354],{},[1097,1373,1350],{},". Suppose ",[1097,1376,1350],{}," adds a method of its own, a getter for the field from Lesson 17.2:",[1113,1379,1381],{"className":1115,"code":1380,"language":1117,"meta":1118,"style":1118},"public class Intake extends RobotPart\n{\n    \u002F\u002F ...hasGamePiece field, constructor, and stop() as in Lessons 17.2 and 18.1\n    public boolean hasGamePiece() { return hasGamePiece; }\n}\n",[1097,1382,1383,1388,1392,1397,1402],{"__ignoreMap":1118},[1122,1384,1385],{"class":1124,"line":1125},[1122,1386,1387],{},"public class Intake extends RobotPart\n",[1122,1389,1390],{"class":1124,"line":1131},[1122,1391,1134],{},[1122,1393,1394],{"class":1124,"line":1137},[1122,1395,1396],{},"    \u002F\u002F ...hasGamePiece field, constructor, and stop() as in Lessons 17.2 and 18.1\n",[1122,1398,1399],{"class":1124,"line":1143},[1122,1400,1401],{},"    public boolean hasGamePiece() { return hasGamePiece; }\n",[1122,1403,1404],{"class":1124,"line":1149},[1122,1405,1152],{},[1085,1407,1408,1411,1412,1415,1416,1418,1419,1171],{},[1097,1409,1410],{},"part.hasGamePiece()"," doesn't compile, since ",[1097,1413,1414],{},"part"," is declared ",[1097,1417,1354],{},". A cast tells the compiler to treat the reference as an ",[1097,1420,1350],{},[1113,1422,1424],{"className":1115,"code":1423,"language":1117,"meta":1118,"style":1118},"RobotPart part = new Intake(\"Front Intake\");  \u002F\u002F upcast: automatic\nIntake intake = (Intake) part;                \u002F\u002F downcast: needs a cast\nSystem.out.println(intake.hasGamePiece());\n",[1097,1425,1426,1431,1436],{"__ignoreMap":1118},[1122,1427,1428],{"class":1124,"line":1125},[1122,1429,1430],{},"RobotPart part = new Intake(\"Front Intake\");  \u002F\u002F upcast: automatic\n",[1122,1432,1433],{"class":1124,"line":1131},[1122,1434,1435],{},"Intake intake = (Intake) part;                \u002F\u002F downcast: needs a cast\n",[1122,1437,1438],{"class":1124,"line":1137},[1122,1439,1440],{},"System.out.println(intake.hasGamePiece());\n",[1085,1442,1443,1444,1446,1447,1171],{},"The cast is checked when the program runs. If the object isn't really an ",[1097,1445,1350],{},", it throws a ",[1097,1448,1449],{},"ClassCastException",[1113,1451,1453],{"className":1115,"code":1452,"language":1117,"meta":1118,"style":1118},"RobotPart other = new Climber(\"Left Climber\");\n\u002F\u002F compiles, but throws ClassCastException when it runs: a Climber isn't an Intake\nIntake wrong = (Intake) other;\n",[1097,1454,1455,1460,1465],{"__ignoreMap":1118},[1122,1456,1457],{"class":1124,"line":1125},[1122,1458,1459],{},"RobotPart other = new Climber(\"Left Climber\");\n",[1122,1461,1462],{"class":1124,"line":1131},[1122,1463,1464],{},"\u002F\u002F compiles, but throws ClassCastException when it runs: a Climber isn't an Intake\n",[1122,1466,1467],{"class":1124,"line":1137},[1122,1468,1469],{},"Intake wrong = (Intake) other;\n",[1085,1471,1472,1473,1476,1477,1480,1481,1483,1484,1486,1487,1490,1491,1493,1494,1171],{},"So check with ",[1097,1474,1475],{},"instanceof"," first. Since Java 16, the check and the cast combine into one step with a ",[1092,1478,1479],{},"pattern",": if ",[1097,1482,1414],{}," refers to an ",[1097,1485,1350],{},", the new variable ",[1097,1488,1489],{},"i"," is that same object, already typed as ",[1097,1492,1350],{},", inside the ",[1097,1495,1308],{},[1113,1497,1499],{"className":1115,"code":1498,"language":1117,"meta":1118,"style":1118},"if (part instanceof Intake i)\n{\n    System.out.println(\"Holding a piece: \" + i.hasGamePiece());\n}\n",[1097,1500,1501,1506,1510,1515],{"__ignoreMap":1118},[1122,1502,1503],{"class":1124,"line":1125},[1122,1504,1505],{},"if (part instanceof Intake i)\n",[1122,1507,1508],{"class":1124,"line":1131},[1122,1509,1134],{},[1122,1511,1512],{"class":1124,"line":1137},[1122,1513,1514],{},"    System.out.println(\"Holding a piece: \" + i.hasGamePiece());\n",[1122,1516,1517],{"class":1124,"line":1143},[1122,1518,1152],{},[1085,1520,1521],{},"Needing lots of downcasts is usually a sign the method belongs in the superclass as an override — polymorphism exists so most code never has to ask \"which kind is this?\"",[1080,1523,1525],{"id":1524},"static-methods-dont-get-this","Static Methods Don't Get This",[1085,1527,1528,1529,1532],{},"Polymorphic dispatch only applies to regular (instance) methods. A ",[1097,1530,1531],{},"static"," method call is resolved entirely by the declared type, at compile time — there's no runtime lookup involved at all, since static methods belong to the class itself, not to any particular object.",[1080,1534,1536],{"id":1535},"common-pitfalls","Common Pitfalls",[1538,1539,1540,1551,1561,1587],"ul",{},[1541,1542,1543,1546,1547,1550],"li",{},[1088,1544,1545],{},"Assuming the compiler checks the actual type."," It never does — ",[1097,1548,1549],{},"message.indexOf(\"h\")"," fails to compile even when the real object genuinely has that method, because the compiler only ever consults the declared type.",[1541,1552,1553,1556,1557,1560],{},[1088,1554,1555],{},"Forgetting that runtime dispatch is what actually decides which override runs."," The declared type only gates ",[1092,1558,1559],{},"whether the code compiles"," — which specific version executes is always decided by the real, actual object type.",[1541,1562,1563,1566,1567,1570,1571,1573,1574,1576,1577,1579,1580,1582,1583,1586],{},[1088,1564,1565],{},"Downcasting without checking."," ",[1097,1568,1569],{},"(Intake) part"," compiles whenever ",[1097,1572,1414],{}," could be an ",[1097,1575,1350],{},", but throws ",[1097,1578,1449],{}," at runtime if it isn't — guard it with ",[1097,1581,1475],{},", or use the ",[1097,1584,1585],{},"part instanceof Intake i"," pattern.",[1541,1588,1589,1592],{},[1088,1590,1591],{},"Expecting polymorphism to apply to static methods."," Static method calls are resolved by declared type alone, with no runtime dispatch — they don't participate in overriding the way instance methods do.",[1080,1594,1596],{"id":1595},"key-takeaways","Key Takeaways",[1538,1598,1599,1602,1605,1621,1631],{},[1541,1600,1601],{},"Polymorphism means the method that runs depends on an object's actual runtime type, not its variable's declared type.",[1541,1603,1604],{},"The compiler only checks the declared type for whether a method call is legal; the JVM decides which overridden version actually runs based on the real, actual type.",[1541,1606,1607,1608,1610,1611,1613,1614,1613,1617,1620],{},"This is why a ",[1097,1609,1354],{},"-typed array or method parameter can transparently work with ",[1097,1612,1350],{},", ",[1097,1615,1616],{},"Climber",[1097,1618,1619],{},"Shooter",", or any other subclass — one piece of code, many possible real behaviors.",[1541,1622,1623,1624,1626,1627,1630],{},"Upcasts are automatic; downcasts need an explicit cast, can throw ",[1097,1625,1449],{},", and are safest as ",[1097,1628,1629],{},"if (x instanceof Intake i)",".",[1541,1632,1633],{},"Static methods don't participate in this — they're resolved entirely by declared type, at compile time.",[1085,1635,1636,1637,1640,1641,1644,1645,1648,1649,1651],{},"Derived from ",[1097,1638,1639],{},"csawesome-2026",": ",[1097,1642,1643],{},"unit-5-inheritance-optional\u002F5.06-polymorphism.md"," (CSA 5.6)\n",[1088,1646,1647],{},"Deck context:"," mechacoder-test\u002Fsrc\u002Flessons\u002Fjava-2.js, slide 5 (\"Polymorphism: Many Forms\") — the deck's vendor motor classes are replaced here by WPILib's generic ",[1097,1650,1099],{}," interface",[1653,1654,1655],"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":1118,"searchDepth":1131,"depth":1131,"links":1657},[1658,1659,1660,1661,1662,1663,1664],{"id":1082,"depth":1131,"text":1083},{"id":1155,"depth":1131,"text":1156},{"id":1249,"depth":1131,"text":1250},{"id":1343,"depth":1131,"text":1344},{"id":1524,"depth":1131,"text":1525},{"id":1535,"depth":1131,"text":1536},{"id":1595,"depth":1131,"text":1596},"md",{"outlineRef":1667,"status":1668},"18.3 — Polymorphism (CSA 5.6)","new — authored lesson (fuller depth than the teaser slide)",true,{"title":238,"description":1118},"-FrB-Ojd4DTl1DcixGURN4svBYAmWMgQ39cQpnTa5jw",{"id":1673,"title":671,"body":1674,"description":1118,"extension":1665,"meta":2316,"navigation":1669,"path":670,"seo":2319,"stem":672,"__hash__":2320},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism.md",{"type":1073,"value":1675,"toc":2306},[1676,1679,1683,1710,1714,1850,1856,1860,1874,1902,1928,1935,2139,2143,2151,2176,2180,2189,2212,2218,2233,2239,2269,2273,2304],[1076,1677,671],{"id":1678},"polymorphism-worked-example",[1080,1680,1682],{"id":1681},"problem","Problem",[1085,1684,1685,1686,1689,1690,1693,1694,1697,1698,1701,1702,1705,1706,1709],{},"The team has several autonomous routines. Every routine has a ",[1097,1687,1688],{},"run()"," method; a plain ",[1097,1691,1692],{},"AutoRoutine"," just sits still, while ",[1097,1695,1696],{},"LeaveZone"," drives out of the starting zone and ",[1097,1699,1700],{},"ScoreOne"," scores a preloaded game piece. Write ",[1088,1703,1704],{},"one"," method, ",[1097,1707,1708],{},"startAuto",", that can start any routine it's handed — without checking which kind of routine it is.",[1080,1711,1713],{"id":1712},"step-1-the-superclass-and-two-subclasses","Step 1: The Superclass and Two Subclasses",[1113,1715,1717],{"className":1115,"code":1716,"language":1117,"meta":1118,"style":1118},"class AutoRoutine\n{\n    public void run()\n    {\n        System.out.println(\"Auto: sitting still\");\n    }\n}\n\nclass LeaveZone extends AutoRoutine\n{\n    @Override\n    public void run()\n    {\n        System.out.println(\"Auto: driving out of the starting zone\");\n    }\n}\n\nclass ScoreOne extends AutoRoutine\n{\n    @Override\n    public void run()\n    {\n        System.out.println(\"Auto: scoring the preloaded piece\");\n    }\n}\n",[1097,1718,1719,1724,1728,1733,1738,1743,1749,1754,1760,1766,1771,1777,1782,1787,1793,1798,1803,1808,1814,1819,1824,1829,1834,1840,1845],{"__ignoreMap":1118},[1122,1720,1721],{"class":1124,"line":1125},[1122,1722,1723],{},"class AutoRoutine\n",[1122,1725,1726],{"class":1124,"line":1131},[1122,1727,1134],{},[1122,1729,1730],{"class":1124,"line":1137},[1122,1731,1732],{},"    public void run()\n",[1122,1734,1735],{"class":1124,"line":1143},[1122,1736,1737],{},"    {\n",[1122,1739,1740],{"class":1124,"line":1149},[1122,1741,1742],{},"        System.out.println(\"Auto: sitting still\");\n",[1122,1744,1746],{"class":1124,"line":1745},6,[1122,1747,1748],{},"    }\n",[1122,1750,1752],{"class":1124,"line":1751},7,[1122,1753,1152],{},[1122,1755,1757],{"class":1124,"line":1756},8,[1122,1758,1759],{"emptyLinePlaceholder":1669},"\n",[1122,1761,1763],{"class":1124,"line":1762},9,[1122,1764,1765],{},"class LeaveZone extends AutoRoutine\n",[1122,1767,1769],{"class":1124,"line":1768},10,[1122,1770,1134],{},[1122,1772,1774],{"class":1124,"line":1773},11,[1122,1775,1776],{},"    @Override\n",[1122,1778,1780],{"class":1124,"line":1779},12,[1122,1781,1732],{},[1122,1783,1785],{"class":1124,"line":1784},13,[1122,1786,1737],{},[1122,1788,1790],{"class":1124,"line":1789},14,[1122,1791,1792],{},"        System.out.println(\"Auto: driving out of the starting zone\");\n",[1122,1794,1796],{"class":1124,"line":1795},15,[1122,1797,1748],{},[1122,1799,1801],{"class":1124,"line":1800},16,[1122,1802,1152],{},[1122,1804,1806],{"class":1124,"line":1805},17,[1122,1807,1759],{"emptyLinePlaceholder":1669},[1122,1809,1811],{"class":1124,"line":1810},18,[1122,1812,1813],{},"class ScoreOne extends AutoRoutine\n",[1122,1815,1817],{"class":1124,"line":1816},19,[1122,1818,1134],{},[1122,1820,1822],{"class":1124,"line":1821},20,[1122,1823,1776],{},[1122,1825,1827],{"class":1124,"line":1826},21,[1122,1828,1732],{},[1122,1830,1832],{"class":1124,"line":1831},22,[1122,1833,1737],{},[1122,1835,1837],{"class":1124,"line":1836},23,[1122,1838,1839],{},"        System.out.println(\"Auto: scoring the preloaded piece\");\n",[1122,1841,1843],{"class":1124,"line":1842},24,[1122,1844,1748],{},[1122,1846,1848],{"class":1124,"line":1847},25,[1122,1849,1152],{},[1085,1851,1852,1853,1855],{},"Each subclass overrides ",[1097,1854,1688],{}," (Lesson 18.1) with its own behavior.",[1080,1857,1859],{"id":1858},"step-2-one-method-typed-against-the-superclass","Step 2: One Method, Typed Against the Superclass",[1085,1861,1862,1864,1865,1867,1868,1566,1870,1873],{},[1097,1863,1708],{},"'s parameter is declared as ",[1097,1866,1692],{},", so it accepts an ",[1097,1869,1692],{},[1092,1871,1872],{},"or any subclass of it"," (Lesson 17.3):",[1113,1875,1877],{"className":1115,"code":1876,"language":1117,"meta":1118,"style":1118},"public static void startAuto(AutoRoutine routine)\n{\n    System.out.println(\"Starting autonomous...\");\n    routine.run();\n}\n",[1097,1878,1879,1884,1888,1893,1898],{"__ignoreMap":1118},[1122,1880,1881],{"class":1124,"line":1125},[1122,1882,1883],{},"public static void startAuto(AutoRoutine routine)\n",[1122,1885,1886],{"class":1124,"line":1131},[1122,1887,1134],{},[1122,1889,1890],{"class":1124,"line":1137},[1122,1891,1892],{},"    System.out.println(\"Starting autonomous...\");\n",[1122,1894,1895],{"class":1124,"line":1143},[1122,1896,1897],{},"    routine.run();\n",[1122,1899,1900],{"class":1124,"line":1149},[1122,1901,1152],{},[1085,1903,1904,1905,1613,1907,1233,1910,1912,1913,1915,1916,1918,1919,1921,1922,1924,1925,1927],{},"Inside ",[1097,1906,1708],{},[1097,1908,1909],{},"routine",[1088,1911,1197],{}," type is always ",[1097,1914,1692],{},". The compiler checks that ",[1097,1917,1692],{}," has a ",[1097,1920,1688],{}," method — it does — so the call compiles. Which ",[1097,1923,1688],{}," actually executes is decided later, at runtime, by the ",[1088,1926,1094],{}," object passed in.",[1080,1929,1931,1932],{"id":1930},"step-3-put-it-together-in-main","Step 3: Put It Together in ",[1097,1933,1934],{},"main",[1113,1936,1938],{"className":1115,"code":1937,"language":1117,"meta":1118,"style":1118},"public class AutoSelector\n{\n    public static void startAuto(AutoRoutine routine)\n    {\n        System.out.println(\"Starting autonomous...\");\n        routine.run();\n    }\n\n    public static void main(String[] args)\n    {\n        AutoRoutine picked = new ScoreOne(); \u002F\u002F declared AutoRoutine, actually a ScoreOne\n\n        startAuto(new AutoRoutine());\n        startAuto(new LeaveZone());\n        startAuto(picked);\n    }\n}\n\nclass AutoRoutine\n{\n    public void run()\n    {\n        System.out.println(\"Auto: sitting still\");\n    }\n}\n\nclass LeaveZone extends AutoRoutine\n{\n    @Override\n    public void run()\n    {\n        System.out.println(\"Auto: driving out of the starting zone\");\n    }\n}\n\nclass ScoreOne extends AutoRoutine\n{\n    @Override\n    public void run()\n    {\n        System.out.println(\"Auto: scoring the preloaded piece\");\n    }\n}\n",[1097,1939,1940,1945,1949,1954,1958,1963,1968,1972,1976,1981,1985,1990,1994,1999,2004,2009,2013,2017,2021,2025,2029,2033,2037,2041,2045,2049,2054,2059,2064,2069,2074,2079,2084,2089,2094,2099,2104,2109,2114,2119,2124,2129,2134],{"__ignoreMap":1118},[1122,1941,1942],{"class":1124,"line":1125},[1122,1943,1944],{},"public class AutoSelector\n",[1122,1946,1947],{"class":1124,"line":1131},[1122,1948,1134],{},[1122,1950,1951],{"class":1124,"line":1137},[1122,1952,1953],{},"    public static void startAuto(AutoRoutine routine)\n",[1122,1955,1956],{"class":1124,"line":1143},[1122,1957,1737],{},[1122,1959,1960],{"class":1124,"line":1149},[1122,1961,1962],{},"        System.out.println(\"Starting autonomous...\");\n",[1122,1964,1965],{"class":1124,"line":1745},[1122,1966,1967],{},"        routine.run();\n",[1122,1969,1970],{"class":1124,"line":1751},[1122,1971,1748],{},[1122,1973,1974],{"class":1124,"line":1756},[1122,1975,1759],{"emptyLinePlaceholder":1669},[1122,1977,1978],{"class":1124,"line":1762},[1122,1979,1980],{},"    public static void main(String[] args)\n",[1122,1982,1983],{"class":1124,"line":1768},[1122,1984,1737],{},[1122,1986,1987],{"class":1124,"line":1773},[1122,1988,1989],{},"        AutoRoutine picked = new ScoreOne(); \u002F\u002F declared AutoRoutine, actually a ScoreOne\n",[1122,1991,1992],{"class":1124,"line":1779},[1122,1993,1759],{"emptyLinePlaceholder":1669},[1122,1995,1996],{"class":1124,"line":1784},[1122,1997,1998],{},"        startAuto(new AutoRoutine());\n",[1122,2000,2001],{"class":1124,"line":1789},[1122,2002,2003],{},"        startAuto(new LeaveZone());\n",[1122,2005,2006],{"class":1124,"line":1795},[1122,2007,2008],{},"        startAuto(picked);\n",[1122,2010,2011],{"class":1124,"line":1800},[1122,2012,1748],{},[1122,2014,2015],{"class":1124,"line":1805},[1122,2016,1152],{},[1122,2018,2019],{"class":1124,"line":1810},[1122,2020,1759],{"emptyLinePlaceholder":1669},[1122,2022,2023],{"class":1124,"line":1816},[1122,2024,1723],{},[1122,2026,2027],{"class":1124,"line":1821},[1122,2028,1134],{},[1122,2030,2031],{"class":1124,"line":1826},[1122,2032,1732],{},[1122,2034,2035],{"class":1124,"line":1831},[1122,2036,1737],{},[1122,2038,2039],{"class":1124,"line":1836},[1122,2040,1742],{},[1122,2042,2043],{"class":1124,"line":1842},[1122,2044,1748],{},[1122,2046,2047],{"class":1124,"line":1847},[1122,2048,1152],{},[1122,2050,2052],{"class":1124,"line":2051},26,[1122,2053,1759],{"emptyLinePlaceholder":1669},[1122,2055,2057],{"class":1124,"line":2056},27,[1122,2058,1765],{},[1122,2060,2062],{"class":1124,"line":2061},28,[1122,2063,1134],{},[1122,2065,2067],{"class":1124,"line":2066},29,[1122,2068,1776],{},[1122,2070,2072],{"class":1124,"line":2071},30,[1122,2073,1732],{},[1122,2075,2077],{"class":1124,"line":2076},31,[1122,2078,1737],{},[1122,2080,2082],{"class":1124,"line":2081},32,[1122,2083,1792],{},[1122,2085,2087],{"class":1124,"line":2086},33,[1122,2088,1748],{},[1122,2090,2092],{"class":1124,"line":2091},34,[1122,2093,1152],{},[1122,2095,2097],{"class":1124,"line":2096},35,[1122,2098,1759],{"emptyLinePlaceholder":1669},[1122,2100,2102],{"class":1124,"line":2101},36,[1122,2103,1813],{},[1122,2105,2107],{"class":1124,"line":2106},37,[1122,2108,1134],{},[1122,2110,2112],{"class":1124,"line":2111},38,[1122,2113,1776],{},[1122,2115,2117],{"class":1124,"line":2116},39,[1122,2118,1732],{},[1122,2120,2122],{"class":1124,"line":2121},40,[1122,2123,1737],{},[1122,2125,2127],{"class":1124,"line":2126},41,[1122,2128,1839],{},[1122,2130,2132],{"class":1124,"line":2131},42,[1122,2133,1748],{},[1122,2135,2137],{"class":1124,"line":2136},43,[1122,2138,1152],{},[1080,2140,2142],{"id":2141},"what-it-prints","What It Prints",[1113,2144,2149],{"className":2145,"code":2147,"language":2148},[2146],"language-text","Starting autonomous...\nAuto: sitting still\nStarting autonomous...\nAuto: driving out of the starting zone\nStarting autonomous...\nAuto: scoring the preloaded piece\n","text",[1097,2150,2147],{"__ignoreMap":1118},[1085,2152,2153,2154,2157,2158,1415,2161,2163,2164,2167,2168,2170,2171,1293,2173,2175],{},"The same line of code, ",[1097,2155,2156],{},"routine.run()",", produced three different behaviors — one per actual object type. ",[1097,2159,2160],{},"picked",[1097,2162,1692],{},", but the object it refers to was built with ",[1097,2165,2166],{},"new ScoreOne()",", so ",[1097,2169,1700],{},"'s override is what runs. There's no ",[1097,2172,1308],{},[1097,2174,1311],{}," anywhere checking which routine it is.",[1080,2177,2179],{"id":2178},"step-4-the-declared-type-still-decides-what-compiles","Step 4: The Declared Type Still Decides What Compiles",[1085,2181,2182,2183,2185,2186,2188],{},"Say ",[1097,2184,1700],{}," also had a method of its own that ",[1097,2187,1692],{}," doesn't:",[1113,2190,2192],{"className":1115,"code":2191,"language":1117,"meta":1118,"style":1118},"public int getPieceCount()\n{\n    return 1;\n}\n",[1097,2193,2194,2199,2203,2208],{"__ignoreMap":1118},[1122,2195,2196],{"class":1124,"line":1125},[1122,2197,2198],{},"public int getPieceCount()\n",[1122,2200,2201],{"class":1124,"line":1131},[1122,2202,1134],{},[1122,2204,2205],{"class":1124,"line":1137},[1122,2206,2207],{},"    return 1;\n",[1122,2209,2210],{"class":1124,"line":1143},[1122,2211,1152],{},[1085,2213,2214,2215,2217],{},"Calling it through ",[1097,2216,2160],{}," doesn't compile:",[1113,2219,2221],{"className":1115,"code":2220,"language":1117,"meta":1118,"style":1118},"AutoRoutine picked = new ScoreOne();\npicked.getPieceCount(); \u002F\u002F COMPILE ERROR — AutoRoutine has no getPieceCount()\n",[1097,2222,2223,2228],{"__ignoreMap":1118},[1122,2224,2225],{"class":1124,"line":1125},[1122,2226,2227],{},"AutoRoutine picked = new ScoreOne();\n",[1122,2229,2230],{"class":1124,"line":1131},[1122,2231,2232],{},"picked.getPieceCount(); \u002F\u002F COMPILE ERROR — AutoRoutine has no getPieceCount()\n",[1113,2234,2237],{"className":2235,"code":2236,"language":2148},[2146],"error: cannot find symbol\n        picked.getPieceCount();\n              ^\n  symbol:   method getPieceCount()\n  location: variable picked of type AutoRoutine\n",[1097,2238,2236],{"__ignoreMap":1118},[1085,2240,2241,2242,2245,2246,2248,2249,2252,2253,2255,2256,2258,2259,2261,2262,2264,2265,2268],{},"The real object ",[1092,2243,2244],{},"is"," a ",[1097,2247,1700],{}," and genuinely has ",[1097,2250,2251],{},"getPieceCount()"," — but the compiler only looks at the declared type, ",[1097,2254,1692],{},", which never promised that method. Polymorphism works for ",[1097,2257,1688],{}," because ",[1097,2260,1692],{}," declares ",[1097,2263,1688],{},"; the subclasses only change ",[1092,2266,2267],{},"which version"," runs.",[1080,2270,2272],{"id":2271},"recap","Recap",[1538,2274,2275,2281,2287,2293],{},[1541,2276,2277,2278,2280],{},"A parameter (or variable) declared as a superclass type can hold any subclass object; one method like ",[1097,2279,1708],{}," then works for every kind of routine.",[1541,2282,2283,2284,2286],{},"The compiler checks method calls against the ",[1088,2285,1197],{}," type only — a subclass-only method can't be called through a superclass-typed variable.",[1541,2288,2289,2290,2292],{},"Once a call compiles, the ",[1088,2291,1094],{}," object's type decides which override runs, at runtime.",[1541,2294,2295,2296,2298,2299,1293,2301,2303],{},"That's polymorphism: one line of code, ",[1097,2297,2156],{},", many possible behaviors, with no type-checking ",[1097,2300,1308],{},[1097,2302,1311],{}," chain.",[1653,2305,1655],{},{"title":1118,"searchDepth":1131,"depth":1131,"links":2307},[2308,2309,2310,2311,2313,2314,2315],{"id":1681,"depth":1131,"text":1682},{"id":1712,"depth":1131,"text":1713},{"id":1858,"depth":1131,"text":1859},{"id":1930,"depth":1131,"text":2312},"Step 3: Put It Together in main",{"id":2141,"depth":1131,"text":2142},{"id":2178,"depth":1131,"text":2179},{"id":2271,"depth":1131,"text":2272},{"outlineRef":1667,"pairsWith":2317,"status":2318},"[`lessons\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism.md`](..\u002F..\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt)",{"title":671,"description":1118},"937mFr_QTNDL-NwJtqyFY_YfGAU3hwGKixeysGjdQWE",{"id":2322,"title":984,"body":2323,"description":1118,"extension":1665,"meta":4074,"navigation":1669,"path":983,"seo":4076,"stem":985,"__hash__":4077},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism.md",{"type":1073,"value":2324,"toc":4069},[2325,2328,2332,2358,2378,2381,2386,2423,2429,2462,2490,2494,2522,2528,2674,2677,2721,2726,2732,2900,2964,2968,2974,3003,3026,3047,3053,3058,3455,3460,3465,3471,3476,3481,3486,3490,3496,3500,3506,3511,3515,3521,3525,3531,3536,3540,3546,3550,3556,3561,3565,3571,3575,3581,3586,4010,4067],[1076,2326,984],{"id":2327},"polymorphism-exercises",[1080,2329,2331],{"id":2330},"multiple-choice","Multiple Choice",[1085,2333,2334,1566,2337,1918,2340,2343,2344,2347,2348,2350,2351,2354,2355,2357],{},[1088,2335,2336],{},"Question:",[1097,2338,2339],{},"GamePiece",[1097,2341,2342],{},"score()"," method. ",[1097,2345,2346],{},"Coral extends GamePiece",", overrides ",[1097,2349,2342],{},", and also adds a method of its own, ",[1097,2352,2353],{},"rotate()",", which ",[1097,2356,2339],{}," doesn't have. A teammate writes:",[1113,2359,2361],{"className":1115,"code":2360,"language":1117,"meta":1118,"style":1118},"GamePiece piece = new Coral();\npiece.score();\npiece.rotate();\n",[1097,2362,2363,2368,2373],{"__ignoreMap":1118},[1122,2364,2365],{"class":1124,"line":1125},[1122,2366,2367],{},"GamePiece piece = new Coral();\n",[1122,2369,2370],{"class":1124,"line":1131},[1122,2371,2372],{},"piece.score();\n",[1122,2374,2375],{"class":1124,"line":1137},[1122,2376,2377],{},"piece.rotate();\n",[1085,2379,2380],{},"What happens?",[1085,2382,2383],{},[1088,2384,2385],{},"Options:",[1538,2387,2388,2403,2412,2417],{},[1541,2389,2390,2391,2394,2395,2398,2399,2402],{},"A. It doesn't compile, because of ",[1097,2392,2393],{},"piece.rotate()","; if that line is removed, ",[1097,2396,2397],{},"piece.score()"," runs ",[1097,2400,2401],{},"Coral","'s version",[1541,2404,2405,2406,2394,2408,2398,2410,2402],{},"B. It doesn't compile, because of ",[1097,2407,2393],{},[1097,2409,2397],{},[1097,2411,2339],{},[1541,2413,2414,2415],{},"C. It compiles and runs both lines, because the actual object is a ",[1097,2416,2401],{},[1541,2418,2419,2420,2422],{},"D. It compiles, but ",[1097,2421,2393],{}," crashes when the program runs",[1085,2424,2425,2428],{},[1088,2426,2427],{},"Answer:"," A",[1085,2430,2431,2434,2435,1236,2437,2439,2440,2442,2443,2445,2446,2167,2448,2450,2451,2453,2454,2456,2457,2167,2459,2461],{},[1088,2432,2433],{},"Why:"," The compiler checks each call against the variable's ",[1088,2436,1197],{},[1097,2438,2339],{},". ",[1097,2441,2339],{}," has ",[1097,2444,2342],{},", so that call is fine — but it has no ",[1097,2447,2353],{},[1097,2449,2393],{}," is a compile error, even though the real object has one. Once the code compiles, the JVM picks which ",[1097,2452,2342],{}," runs from the ",[1088,2455,1094],{}," object type, ",[1097,2458,2401],{},[1097,2460,2401],{},"'s override runs.",[1538,2463,2464,2482,2487],{},[1541,2465,2466,2467,2470,2471,2473,2474,1233,2476,2478,2479,2481],{},"B is wrong — the declared type only decides ",[1092,2468,2469],{},"whether"," a call compiles, not ",[1092,2472,2267],{}," runs. Runtime dispatch uses the actual type, so ",[1097,2475,2401],{},[1097,2477,2342],{}," runs, not ",[1097,2480,2339],{},"'s.",[1541,2483,2484,2485,1630],{},"C is wrong — it assumes the compiler looks at the actual object. It never does; it only consults the declared type, ",[1097,2486,2339],{},[1541,2488,2489],{},"D is wrong — this problem is caught at compile time, before the program ever runs. The code never gets far enough to crash.",[1080,2491,2493],{"id":2492},"micro-parsons","Micro-Parsons",[1085,2495,2496,2499,2500,2502,2503,2505,2506,2509,2510,2513,2514,2517,2518,2521],{},[1088,2497,2498],{},"Problem:"," Given these alert classes and the class holding ",[1097,2501,1934],{},", reorder the fragments below into the body of ",[1097,2504,1934],{}," (where the comment is). It should build an ",[1097,2507,2508],{},"Alert[]"," array of size 2, put a ",[1097,2511,2512],{},"RumbleAlert"," at index 0 and a ",[1097,2515,2516],{},"LightAlert"," at index 1, then loop over the array calling ",[1097,2519,2520],{},"send()"," on each element. The program should print:",[1113,2523,2526],{"className":2524,"code":2525,"language":2148},[2146],"Rumbling the driver controller\nFlashing the LEDs orange\n",[1097,2527,2525],{"__ignoreMap":1118},[1113,2529,2531],{"className":1115,"code":2530,"language":1117,"meta":1118,"style":1118},"public class AlertTest\n{\n    public static void main(String[] args)\n    {\n        \u002F\u002F main body goes here\n    }\n}\n\nclass Alert\n{\n    public void send()\n    {\n        System.out.println(\"Generic alert\");\n    }\n}\n\nclass RumbleAlert extends Alert\n{\n    @Override\n    public void send()\n    {\n        System.out.println(\"Rumbling the driver controller\");\n    }\n}\n\nclass LightAlert extends Alert\n{\n    @Override\n    public void send()\n    {\n        System.out.println(\"Flashing the LEDs orange\");\n    }\n}\n",[1097,2532,2533,2538,2542,2546,2550,2555,2559,2563,2567,2572,2576,2581,2585,2590,2594,2598,2602,2607,2611,2615,2619,2623,2628,2632,2636,2640,2645,2649,2653,2657,2661,2666,2670],{"__ignoreMap":1118},[1122,2534,2535],{"class":1124,"line":1125},[1122,2536,2537],{},"public class AlertTest\n",[1122,2539,2540],{"class":1124,"line":1131},[1122,2541,1134],{},[1122,2543,2544],{"class":1124,"line":1137},[1122,2545,1980],{},[1122,2547,2548],{"class":1124,"line":1143},[1122,2549,1737],{},[1122,2551,2552],{"class":1124,"line":1149},[1122,2553,2554],{},"        \u002F\u002F main body goes here\n",[1122,2556,2557],{"class":1124,"line":1745},[1122,2558,1748],{},[1122,2560,2561],{"class":1124,"line":1751},[1122,2562,1152],{},[1122,2564,2565],{"class":1124,"line":1756},[1122,2566,1759],{"emptyLinePlaceholder":1669},[1122,2568,2569],{"class":1124,"line":1762},[1122,2570,2571],{},"class Alert\n",[1122,2573,2574],{"class":1124,"line":1768},[1122,2575,1134],{},[1122,2577,2578],{"class":1124,"line":1773},[1122,2579,2580],{},"    public void send()\n",[1122,2582,2583],{"class":1124,"line":1779},[1122,2584,1737],{},[1122,2586,2587],{"class":1124,"line":1784},[1122,2588,2589],{},"        System.out.println(\"Generic alert\");\n",[1122,2591,2592],{"class":1124,"line":1789},[1122,2593,1748],{},[1122,2595,2596],{"class":1124,"line":1795},[1122,2597,1152],{},[1122,2599,2600],{"class":1124,"line":1800},[1122,2601,1759],{"emptyLinePlaceholder":1669},[1122,2603,2604],{"class":1124,"line":1805},[1122,2605,2606],{},"class RumbleAlert extends Alert\n",[1122,2608,2609],{"class":1124,"line":1810},[1122,2610,1134],{},[1122,2612,2613],{"class":1124,"line":1816},[1122,2614,1776],{},[1122,2616,2617],{"class":1124,"line":1821},[1122,2618,2580],{},[1122,2620,2621],{"class":1124,"line":1826},[1122,2622,1737],{},[1122,2624,2625],{"class":1124,"line":1831},[1122,2626,2627],{},"        System.out.println(\"Rumbling the driver controller\");\n",[1122,2629,2630],{"class":1124,"line":1836},[1122,2631,1748],{},[1122,2633,2634],{"class":1124,"line":1842},[1122,2635,1152],{},[1122,2637,2638],{"class":1124,"line":1847},[1122,2639,1759],{"emptyLinePlaceholder":1669},[1122,2641,2642],{"class":1124,"line":2051},[1122,2643,2644],{},"class LightAlert extends Alert\n",[1122,2646,2647],{"class":1124,"line":2056},[1122,2648,1134],{},[1122,2650,2651],{"class":1124,"line":2061},[1122,2652,1776],{},[1122,2654,2655],{"class":1124,"line":2066},[1122,2656,2580],{},[1122,2658,2659],{"class":1124,"line":2071},[1122,2660,1737],{},[1122,2662,2663],{"class":1124,"line":2076},[1122,2664,2665],{},"        System.out.println(\"Flashing the LEDs orange\");\n",[1122,2667,2668],{"class":1124,"line":2081},[1122,2669,1748],{},[1122,2671,2672],{"class":1124,"line":2086},[1122,2673,1152],{},[1085,2675,2676],{},"Reorder the fragments below to complete it:",[1538,2678,2679,2685,2691,2697,2703,2709,2715],{},[1541,2680,2681,2682],{},"a. ",[1097,2683,2684],{},"            a.send();",[1541,2686,2687,2688],{},"b. ",[1097,2689,2690],{},"        alerts[1] = new LightAlert();",[1541,2692,2693,2694],{},"c. ",[1097,2695,2696],{},"        Alert[] alerts = new Alert[2];",[1541,2698,2699,2700],{},"d. ",[1097,2701,2702],{},"        }",[1541,2704,2705,2706],{},"e. ",[1097,2707,2708],{},"        for (Alert a : alerts)",[1541,2710,2711,2712],{},"f. ",[1097,2713,2714],{},"        alerts[0] = new RumbleAlert();",[1541,2716,2717,2718],{},"g. ",[1097,2719,2720],{},"        {",[1085,2722,2723,2725],{},[1088,2724,2427],{}," c, f, b, e, g, a, d",[1085,2727,2728,2731],{},[1088,2729,2730],{},"Interchangeable:"," (f, b)",[1113,2733,2735],{"className":1115,"code":2734,"language":1117,"meta":1118,"style":1118},"public class AlertTest\n{\n    public static void main(String[] args)\n    {\n        Alert[] alerts = new Alert[2];\n        alerts[0] = new RumbleAlert();\n        alerts[1] = new LightAlert();\n        for (Alert a : alerts)\n        {\n            a.send();\n        }\n    }\n}\n\nclass Alert\n{\n    public void send()\n    {\n        System.out.println(\"Generic alert\");\n    }\n}\n\nclass RumbleAlert extends Alert\n{\n    @Override\n    public void send()\n    {\n        System.out.println(\"Rumbling the driver controller\");\n    }\n}\n\nclass LightAlert extends Alert\n{\n    @Override\n    public void send()\n    {\n        System.out.println(\"Flashing the LEDs orange\");\n    }\n}\n",[1097,2736,2737,2741,2745,2749,2753,2758,2763,2768,2773,2778,2783,2788,2792,2796,2800,2804,2808,2812,2816,2820,2824,2828,2832,2836,2840,2844,2848,2852,2856,2860,2864,2868,2872,2876,2880,2884,2888,2892,2896],{"__ignoreMap":1118},[1122,2738,2739],{"class":1124,"line":1125},[1122,2740,2537],{},[1122,2742,2743],{"class":1124,"line":1131},[1122,2744,1134],{},[1122,2746,2747],{"class":1124,"line":1137},[1122,2748,1980],{},[1122,2750,2751],{"class":1124,"line":1143},[1122,2752,1737],{},[1122,2754,2755],{"class":1124,"line":1149},[1122,2756,2757],{},"        Alert[] alerts = new Alert[2];\n",[1122,2759,2760],{"class":1124,"line":1745},[1122,2761,2762],{},"        alerts[0] = new RumbleAlert();\n",[1122,2764,2765],{"class":1124,"line":1751},[1122,2766,2767],{},"        alerts[1] = new LightAlert();\n",[1122,2769,2770],{"class":1124,"line":1756},[1122,2771,2772],{},"        for (Alert a : alerts)\n",[1122,2774,2775],{"class":1124,"line":1762},[1122,2776,2777],{},"        {\n",[1122,2779,2780],{"class":1124,"line":1768},[1122,2781,2782],{},"            a.send();\n",[1122,2784,2785],{"class":1124,"line":1773},[1122,2786,2787],{},"        }\n",[1122,2789,2790],{"class":1124,"line":1779},[1122,2791,1748],{},[1122,2793,2794],{"class":1124,"line":1784},[1122,2795,1152],{},[1122,2797,2798],{"class":1124,"line":1789},[1122,2799,1759],{"emptyLinePlaceholder":1669},[1122,2801,2802],{"class":1124,"line":1795},[1122,2803,2571],{},[1122,2805,2806],{"class":1124,"line":1800},[1122,2807,1134],{},[1122,2809,2810],{"class":1124,"line":1805},[1122,2811,2580],{},[1122,2813,2814],{"class":1124,"line":1810},[1122,2815,1737],{},[1122,2817,2818],{"class":1124,"line":1816},[1122,2819,2589],{},[1122,2821,2822],{"class":1124,"line":1821},[1122,2823,1748],{},[1122,2825,2826],{"class":1124,"line":1826},[1122,2827,1152],{},[1122,2829,2830],{"class":1124,"line":1831},[1122,2831,1759],{"emptyLinePlaceholder":1669},[1122,2833,2834],{"class":1124,"line":1836},[1122,2835,2606],{},[1122,2837,2838],{"class":1124,"line":1842},[1122,2839,1134],{},[1122,2841,2842],{"class":1124,"line":1847},[1122,2843,1776],{},[1122,2845,2846],{"class":1124,"line":2051},[1122,2847,2580],{},[1122,2849,2850],{"class":1124,"line":2056},[1122,2851,1737],{},[1122,2853,2854],{"class":1124,"line":2061},[1122,2855,2627],{},[1122,2857,2858],{"class":1124,"line":2066},[1122,2859,1748],{},[1122,2861,2862],{"class":1124,"line":2071},[1122,2863,1152],{},[1122,2865,2866],{"class":1124,"line":2076},[1122,2867,1759],{"emptyLinePlaceholder":1669},[1122,2869,2870],{"class":1124,"line":2081},[1122,2871,2644],{},[1122,2873,2874],{"class":1124,"line":2086},[1122,2875,1134],{},[1122,2877,2878],{"class":1124,"line":2091},[1122,2879,1776],{},[1122,2881,2882],{"class":1124,"line":2096},[1122,2883,2580],{},[1122,2885,2886],{"class":1124,"line":2101},[1122,2887,1737],{},[1122,2889,2890],{"class":1124,"line":2106},[1122,2891,2665],{},[1122,2893,2894],{"class":1124,"line":2111},[1122,2895,1748],{},[1122,2897,2898],{"class":1124,"line":2116},[1122,2899,1152],{},[1085,2901,2902,2905,2906,2909,2910,2913,2914,2917,2918,2921,2922,2925,2926,2929,2930,2933,2934,2937,2938,2941,2942,2944,2945,2948,2949,1233,2951,2953,2954,2956,2957,2960,2961,2963],{},[1088,2903,2904],{},"Why this order:"," The array (",[1097,2907,2908],{},"c",") has to exist before anything can be stored in it. The two assignments (",[1097,2911,2912],{},"f"," and ",[1097,2915,2916],{},"b",") fill index 0 and index 1 — they can go in either order, since each one writes its own separate slot, and the print order comes from the ",[1092,2919,2920],{},"indexes"," (the loop always visits index 0 first), not from which line ran first. Both must come before the loop, though, or the loop would find empty slots. The loop header (",[1097,2923,2924],{},"e",") and its opening brace (",[1097,2927,2928],{},"g",") come next, then ",[1097,2931,2932],{},"a.send()"," (",[1097,2935,2936],{},"a","), then the loop's closing brace (",[1097,2939,2940],{},"d","). Inside the loop, ",[1097,2943,2936],{}," is declared as a plain ",[1097,2946,2947],{},"Alert",", yet each call runs the actual object's own override — ",[1097,2950,2512],{},[1097,2952,2520],{}," for index 0, ",[1097,2955,2516],{},"'s for index 1. The three alert classes and the ",[1097,2958,2959],{},"AlertTest"," class with ",[1097,2962,1934],{},"'s signature are the given scaffold.",[1080,2965,2967],{"id":2966},"coding","Coding",[1085,2969,2970,2973],{},[1088,2971,2972],{},"Mode:"," full-program",[1085,2975,2976,2978,2979,1613,2981,1613,2983,1613,2985,2987,2988,1918,2990,2993,2994,2996,2997,3000,3001,1171],{},[1088,2977,2498],{}," The robot-part classes below (",[1097,2980,1354],{},[1097,2982,1350],{},[1097,2984,1616],{},[1097,2986,1619],{},") are\nalready written and are not to be changed. Only ",[1097,2989,1350],{},[1097,2991,2992],{},"hasGamePiece()"," method, and each\nsubclass overrides ",[1097,2995,1304],{}," with its own message. Write the class ",[1097,2998,2999],{},"PartManager"," with two static\nmethods that take a ",[1097,3002,1292],{},[1538,3004,3005,3014],{},[1541,3006,3007,3010,3011,3013],{},[1097,3008,3009],{},"stopAll(RobotPart[] parts)"," stops every part, in array order. It must not check which kind of part\nit is looking at: one loop calling ",[1097,3012,1304],{}," is enough, and each object runs its own version.",[1541,3015,3016,3019,3020,3022,3023,3025],{},[1097,3017,3018],{},"countHolding(RobotPart[] parts)"," returns how many parts are an ",[1097,3021,1350],{}," that is currently holding\na game piece. Parts that are not an ",[1097,3024,1350],{}," do not count, and must not crash the method.",[1085,3027,3028,3029,3031,3032,3035,3036,3039,3040,3043,3044,1171],{},"The fixed ",[1097,3030,1934],{}," reads a part count, then one line per part (",[1097,3033,3034],{},"intake name true\u002Ffalse",",\n",[1097,3037,3038],{},"climber name",", or ",[1097,3041,3042],{},"shooter name","), calls both methods, and prints the count. For the input\n",[1097,3045,3046],{},"3 intake Front true climber Left shooter Main",[1113,3048,3051],{"className":3049,"code":3050,"language":2148,"meta":1118},[2146],"[Front] rollers off\n[Left] brake engaged\n[Main] flywheel off\nholding: 1\n",[1097,3052,3050],{"__ignoreMap":1118},[1085,3054,3055],{},[1088,3056,3057],{},"Starter:",[1113,3059,3061],{"className":1115,"code":3060,"language":1117,"meta":1118,"style":1118},"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        int count = in.nextInt();\n        RobotPart[] parts = new RobotPart[count];\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                parts[i] = new Intake(name, in.nextBoolean());\n            }\n            else if (kind.equals(\"climber\"))\n            {\n                parts[i] = new Climber(name);\n            }\n            else\n            {\n                parts[i] = new Shooter(name);\n            }\n        }\n        PartManager.stopAll(parts);\n        System.out.println(\"holding: \" + PartManager.countHolding(parts));\n    }\n}\n\n\u002F\u002F Don't change the four classes below\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    private boolean hasGamePiece;\n\n    public Intake(String name, boolean hasGamePiece)\n    {\n        super(name);\n        this.hasGamePiece = hasGamePiece;\n    }\n\n    public boolean hasGamePiece() { return hasGamePiece; }\n\n    @Override\n    public void stop() { log(\"rollers off\"); }\n}\n\nclass Climber extends RobotPart\n{\n    public Climber(String name) { super(name); }\n\n    @Override\n    public void stop() { log(\"brake engaged\"); }\n}\n\nclass Shooter extends RobotPart\n{\n    public Shooter(String name) { super(name); }\n\n    @Override\n    public void stop() { log(\"flywheel off\"); }\n}\n\nclass PartManager\n{\n    \u002F\u002F TODO: stopAll(RobotPart[]) and countHolding(RobotPart[])\n}\n",[1097,3062,3063,3068,3072,3077,3081,3086,3090,3094,3099,3104,3109,3114,3118,3123,3128,3133,3138,3143,3148,3153,3157,3162,3166,3171,3175,3180,3184,3188,3193,3198,3202,3206,3210,3215,3220,3224,3229,3233,3238,3243,3248,3253,3257,3261,3267,3272,3278,3283,3289,3294,3300,3306,3311,3316,3321,3326,3331,3337,3342,3347,3353,3358,3364,3369,3374,3380,3385,3390,3396,3401,3407,3412,3417,3423,3428,3433,3439,3444,3450],{"__ignoreMap":1118},[1122,3064,3065],{"class":1124,"line":1125},[1122,3066,3067],{},"import java.util.*;\n",[1122,3069,3070],{"class":1124,"line":1131},[1122,3071,1759],{"emptyLinePlaceholder":1669},[1122,3073,3074],{"class":1124,"line":1137},[1122,3075,3076],{},"public class Main\n",[1122,3078,3079],{"class":1124,"line":1143},[1122,3080,1134],{},[1122,3082,3083],{"class":1124,"line":1149},[1122,3084,3085],{},"    \u002F\u002F Don't change main\n",[1122,3087,3088],{"class":1124,"line":1745},[1122,3089,1980],{},[1122,3091,3092],{"class":1124,"line":1751},[1122,3093,1737],{},[1122,3095,3096],{"class":1124,"line":1756},[1122,3097,3098],{},"        Scanner in = new Scanner(System.in);\n",[1122,3100,3101],{"class":1124,"line":1762},[1122,3102,3103],{},"        int count = in.nextInt();\n",[1122,3105,3106],{"class":1124,"line":1768},[1122,3107,3108],{},"        RobotPart[] parts = new RobotPart[count];\n",[1122,3110,3111],{"class":1124,"line":1773},[1122,3112,3113],{},"        for (int i = 0; i \u003C count; i++)\n",[1122,3115,3116],{"class":1124,"line":1779},[1122,3117,2777],{},[1122,3119,3120],{"class":1124,"line":1784},[1122,3121,3122],{},"            String kind = in.next();\n",[1122,3124,3125],{"class":1124,"line":1789},[1122,3126,3127],{},"            String name = in.next();\n",[1122,3129,3130],{"class":1124,"line":1795},[1122,3131,3132],{},"            if (kind.equals(\"intake\"))\n",[1122,3134,3135],{"class":1124,"line":1800},[1122,3136,3137],{},"            {\n",[1122,3139,3140],{"class":1124,"line":1805},[1122,3141,3142],{},"                parts[i] = new Intake(name, in.nextBoolean());\n",[1122,3144,3145],{"class":1124,"line":1810},[1122,3146,3147],{},"            }\n",[1122,3149,3150],{"class":1124,"line":1816},[1122,3151,3152],{},"            else if (kind.equals(\"climber\"))\n",[1122,3154,3155],{"class":1124,"line":1821},[1122,3156,3137],{},[1122,3158,3159],{"class":1124,"line":1826},[1122,3160,3161],{},"                parts[i] = new Climber(name);\n",[1122,3163,3164],{"class":1124,"line":1831},[1122,3165,3147],{},[1122,3167,3168],{"class":1124,"line":1836},[1122,3169,3170],{},"            else\n",[1122,3172,3173],{"class":1124,"line":1842},[1122,3174,3137],{},[1122,3176,3177],{"class":1124,"line":1847},[1122,3178,3179],{},"                parts[i] = new Shooter(name);\n",[1122,3181,3182],{"class":1124,"line":2051},[1122,3183,3147],{},[1122,3185,3186],{"class":1124,"line":2056},[1122,3187,2787],{},[1122,3189,3190],{"class":1124,"line":2061},[1122,3191,3192],{},"        PartManager.stopAll(parts);\n",[1122,3194,3195],{"class":1124,"line":2066},[1122,3196,3197],{},"        System.out.println(\"holding: \" + PartManager.countHolding(parts));\n",[1122,3199,3200],{"class":1124,"line":2071},[1122,3201,1748],{},[1122,3203,3204],{"class":1124,"line":2076},[1122,3205,1152],{},[1122,3207,3208],{"class":1124,"line":2081},[1122,3209,1759],{"emptyLinePlaceholder":1669},[1122,3211,3212],{"class":1124,"line":2086},[1122,3213,3214],{},"\u002F\u002F Don't change the four classes below\n",[1122,3216,3217],{"class":1124,"line":2091},[1122,3218,3219],{},"class RobotPart\n",[1122,3221,3222],{"class":1124,"line":2096},[1122,3223,1134],{},[1122,3225,3226],{"class":1124,"line":2101},[1122,3227,3228],{},"    private String name;\n",[1122,3230,3231],{"class":1124,"line":2106},[1122,3232,1759],{"emptyLinePlaceholder":1669},[1122,3234,3235],{"class":1124,"line":2111},[1122,3236,3237],{},"    public RobotPart(String name) { this.name = name; }\n",[1122,3239,3240],{"class":1124,"line":2116},[1122,3241,3242],{},"    public String getName() { return name; }\n",[1122,3244,3245],{"class":1124,"line":2121},[1122,3246,3247],{},"    public void log(String msg) { System.out.println(\"[\" + name + \"] \" + msg); }\n",[1122,3249,3250],{"class":1124,"line":2126},[1122,3251,3252],{},"    public void stop() { log(\"stopped\"); }\n",[1122,3254,3255],{"class":1124,"line":2131},[1122,3256,1152],{},[1122,3258,3259],{"class":1124,"line":2136},[1122,3260,1759],{"emptyLinePlaceholder":1669},[1122,3262,3264],{"class":1124,"line":3263},44,[1122,3265,3266],{},"class Intake extends RobotPart\n",[1122,3268,3270],{"class":1124,"line":3269},45,[1122,3271,1134],{},[1122,3273,3275],{"class":1124,"line":3274},46,[1122,3276,3277],{},"    private boolean hasGamePiece;\n",[1122,3279,3281],{"class":1124,"line":3280},47,[1122,3282,1759],{"emptyLinePlaceholder":1669},[1122,3284,3286],{"class":1124,"line":3285},48,[1122,3287,3288],{},"    public Intake(String name, boolean hasGamePiece)\n",[1122,3290,3292],{"class":1124,"line":3291},49,[1122,3293,1737],{},[1122,3295,3297],{"class":1124,"line":3296},50,[1122,3298,3299],{},"        super(name);\n",[1122,3301,3303],{"class":1124,"line":3302},51,[1122,3304,3305],{},"        this.hasGamePiece = hasGamePiece;\n",[1122,3307,3309],{"class":1124,"line":3308},52,[1122,3310,1748],{},[1122,3312,3314],{"class":1124,"line":3313},53,[1122,3315,1759],{"emptyLinePlaceholder":1669},[1122,3317,3319],{"class":1124,"line":3318},54,[1122,3320,1401],{},[1122,3322,3324],{"class":1124,"line":3323},55,[1122,3325,1759],{"emptyLinePlaceholder":1669},[1122,3327,3329],{"class":1124,"line":3328},56,[1122,3330,1776],{},[1122,3332,3334],{"class":1124,"line":3333},57,[1122,3335,3336],{},"    public void stop() { log(\"rollers off\"); }\n",[1122,3338,3340],{"class":1124,"line":3339},58,[1122,3341,1152],{},[1122,3343,3345],{"class":1124,"line":3344},59,[1122,3346,1759],{"emptyLinePlaceholder":1669},[1122,3348,3350],{"class":1124,"line":3349},60,[1122,3351,3352],{},"class Climber extends RobotPart\n",[1122,3354,3356],{"class":1124,"line":3355},61,[1122,3357,1134],{},[1122,3359,3361],{"class":1124,"line":3360},62,[1122,3362,3363],{},"    public Climber(String name) { super(name); }\n",[1122,3365,3367],{"class":1124,"line":3366},63,[1122,3368,1759],{"emptyLinePlaceholder":1669},[1122,3370,3372],{"class":1124,"line":3371},64,[1122,3373,1776],{},[1122,3375,3377],{"class":1124,"line":3376},65,[1122,3378,3379],{},"    public void stop() { log(\"brake engaged\"); }\n",[1122,3381,3383],{"class":1124,"line":3382},66,[1122,3384,1152],{},[1122,3386,3388],{"class":1124,"line":3387},67,[1122,3389,1759],{"emptyLinePlaceholder":1669},[1122,3391,3393],{"class":1124,"line":3392},68,[1122,3394,3395],{},"class Shooter extends RobotPart\n",[1122,3397,3399],{"class":1124,"line":3398},69,[1122,3400,1134],{},[1122,3402,3404],{"class":1124,"line":3403},70,[1122,3405,3406],{},"    public Shooter(String name) { super(name); }\n",[1122,3408,3410],{"class":1124,"line":3409},71,[1122,3411,1759],{"emptyLinePlaceholder":1669},[1122,3413,3415],{"class":1124,"line":3414},72,[1122,3416,1776],{},[1122,3418,3420],{"class":1124,"line":3419},73,[1122,3421,3422],{},"    public void stop() { log(\"flywheel off\"); }\n",[1122,3424,3426],{"class":1124,"line":3425},74,[1122,3427,1152],{},[1122,3429,3431],{"class":1124,"line":3430},75,[1122,3432,1759],{"emptyLinePlaceholder":1669},[1122,3434,3436],{"class":1124,"line":3435},76,[1122,3437,3438],{},"class PartManager\n",[1122,3440,3442],{"class":1124,"line":3441},77,[1122,3443,1134],{},[1122,3445,3447],{"class":1124,"line":3446},78,[1122,3448,3449],{},"    \u002F\u002F TODO: stopAll(RobotPart[]) and countHolding(RobotPart[])\n",[1122,3451,3453],{"class":1124,"line":3452},79,[1122,3454,1152],{},[1085,3456,3457],{},[1088,3458,3459],{},"Scenario 1 (visible):",[1085,3461,3462],{},[1088,3463,3464],{},"Input:",[1113,3466,3469],{"className":3467,"code":3468,"language":2148,"meta":1118},[2146],"3 intake Front true climber Left shooter Main\n",[1097,3470,3468],{"__ignoreMap":1118},[1085,3472,3473],{},[1088,3474,3475],{},"Expected output:",[1113,3477,3479],{"className":3478,"code":3050,"language":2148,"meta":1118},[2146],[1097,3480,3050],{"__ignoreMap":1118},[1085,3482,3483],{},[1088,3484,3485],{},"Scenario 2 (visible):",[1085,3487,3488],{},[1088,3489,3464],{},[1113,3491,3494],{"className":3492,"code":3493,"language":2148,"meta":1118},[2146],"2 intake A true intake B false\n",[1097,3495,3493],{"__ignoreMap":1118},[1085,3497,3498],{},[1088,3499,3475],{},[1113,3501,3504],{"className":3502,"code":3503,"language":2148,"meta":1118},[2146],"[A] rollers off\n[B] rollers off\nholding: 1\n",[1097,3505,3503],{"__ignoreMap":1118},[1085,3507,3508],{},[1088,3509,3510],{},"Scenario 3 (hidden):",[1085,3512,3513],{},[1088,3514,3464],{},[1113,3516,3519],{"className":3517,"code":3518,"language":2148,"meta":1118},[2146],"4 shooter S intake X true climber C intake Y true\n",[1097,3520,3518],{"__ignoreMap":1118},[1085,3522,3523],{},[1088,3524,3475],{},[1113,3526,3529],{"className":3527,"code":3528,"language":2148,"meta":1118},[2146],"[S] flywheel off\n[X] rollers off\n[C] brake engaged\n[Y] rollers off\nholding: 2\n",[1097,3530,3528],{"__ignoreMap":1118},[1085,3532,3533],{},[1088,3534,3535],{},"Scenario 4 (hidden):",[1085,3537,3538],{},[1088,3539,3464],{},[1113,3541,3544],{"className":3542,"code":3543,"language":2148,"meta":1118},[2146],"2 climber L climber R\n",[1097,3545,3543],{"__ignoreMap":1118},[1085,3547,3548],{},[1088,3549,3475],{},[1113,3551,3554],{"className":3552,"code":3553,"language":2148,"meta":1118},[2146],"[L] brake engaged\n[R] brake engaged\nholding: 0\n",[1097,3555,3553],{"__ignoreMap":1118},[1085,3557,3558],{},[1088,3559,3560],{},"Scenario 5 (hidden):",[1085,3562,3563],{},[1088,3564,3464],{},[1113,3566,3569],{"className":3567,"code":3568,"language":2148,"meta":1118},[2146],"3 intake Q false shooter T intake U false\n",[1097,3570,3568],{"__ignoreMap":1118},[1085,3572,3573],{},[1088,3574,3475],{},[1113,3576,3579],{"className":3577,"code":3578,"language":2148,"meta":1118},[2146],"[Q] rollers off\n[T] flywheel off\n[U] rollers off\nholding: 0\n",[1097,3580,3578],{"__ignoreMap":1118},[1085,3582,3583],{},[1088,3584,3585],{},"Solution:",[1113,3587,3589],{"className":1115,"code":3588,"language":1117,"meta":1118,"style":1118},"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        int count = in.nextInt();\n        RobotPart[] parts = new RobotPart[count];\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                parts[i] = new Intake(name, in.nextBoolean());\n            }\n            else if (kind.equals(\"climber\"))\n            {\n                parts[i] = new Climber(name);\n            }\n            else\n            {\n                parts[i] = new Shooter(name);\n            }\n        }\n        PartManager.stopAll(parts);\n        System.out.println(\"holding: \" + PartManager.countHolding(parts));\n    }\n}\n\n\u002F\u002F Don't change the four classes below\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    private boolean hasGamePiece;\n\n    public Intake(String name, boolean hasGamePiece)\n    {\n        super(name);\n        this.hasGamePiece = hasGamePiece;\n    }\n\n    public boolean hasGamePiece() { return hasGamePiece; }\n\n    @Override\n    public void stop() { log(\"rollers off\"); }\n}\n\nclass Climber extends RobotPart\n{\n    public Climber(String name) { super(name); }\n\n    @Override\n    public void stop() { log(\"brake engaged\"); }\n}\n\nclass Shooter extends RobotPart\n{\n    public Shooter(String name) { super(name); }\n\n    @Override\n    public void stop() { log(\"flywheel off\"); }\n}\n\nclass PartManager\n{\n    public static void stopAll(RobotPart[] parts)\n    {\n        for (RobotPart p : parts)\n        {\n            p.stop();\n        }\n    }\n\n    public static int countHolding(RobotPart[] parts)\n    {\n        int holding = 0;\n        for (RobotPart p : parts)\n        {\n            if (p instanceof Intake i && i.hasGamePiece())\n            {\n                holding++;\n            }\n        }\n        return holding;\n    }\n}\n",[1097,3590,3591,3595,3599,3603,3607,3611,3615,3619,3623,3627,3631,3635,3639,3643,3647,3651,3655,3659,3663,3667,3671,3675,3679,3683,3687,3691,3695,3699,3703,3707,3711,3715,3719,3723,3727,3731,3735,3739,3743,3747,3751,3755,3759,3763,3767,3771,3775,3779,3783,3787,3791,3795,3799,3803,3807,3811,3815,3819,3823,3827,3831,3835,3839,3843,3847,3851,3855,3859,3863,3867,3871,3875,3879,3883,3887,3891,3895,3899,3904,3908,3914,3919,3925,3930,3935,3940,3946,3951,3957,3962,3967,3973,3978,3984,3989,3994,4000,4005],{"__ignoreMap":1118},[1122,3592,3593],{"class":1124,"line":1125},[1122,3594,3067],{},[1122,3596,3597],{"class":1124,"line":1131},[1122,3598,1759],{"emptyLinePlaceholder":1669},[1122,3600,3601],{"class":1124,"line":1137},[1122,3602,3076],{},[1122,3604,3605],{"class":1124,"line":1143},[1122,3606,1134],{},[1122,3608,3609],{"class":1124,"line":1149},[1122,3610,3085],{},[1122,3612,3613],{"class":1124,"line":1745},[1122,3614,1980],{},[1122,3616,3617],{"class":1124,"line":1751},[1122,3618,1737],{},[1122,3620,3621],{"class":1124,"line":1756},[1122,3622,3098],{},[1122,3624,3625],{"class":1124,"line":1762},[1122,3626,3103],{},[1122,3628,3629],{"class":1124,"line":1768},[1122,3630,3108],{},[1122,3632,3633],{"class":1124,"line":1773},[1122,3634,3113],{},[1122,3636,3637],{"class":1124,"line":1779},[1122,3638,2777],{},[1122,3640,3641],{"class":1124,"line":1784},[1122,3642,3122],{},[1122,3644,3645],{"class":1124,"line":1789},[1122,3646,3127],{},[1122,3648,3649],{"class":1124,"line":1795},[1122,3650,3132],{},[1122,3652,3653],{"class":1124,"line":1800},[1122,3654,3137],{},[1122,3656,3657],{"class":1124,"line":1805},[1122,3658,3142],{},[1122,3660,3661],{"class":1124,"line":1810},[1122,3662,3147],{},[1122,3664,3665],{"class":1124,"line":1816},[1122,3666,3152],{},[1122,3668,3669],{"class":1124,"line":1821},[1122,3670,3137],{},[1122,3672,3673],{"class":1124,"line":1826},[1122,3674,3161],{},[1122,3676,3677],{"class":1124,"line":1831},[1122,3678,3147],{},[1122,3680,3681],{"class":1124,"line":1836},[1122,3682,3170],{},[1122,3684,3685],{"class":1124,"line":1842},[1122,3686,3137],{},[1122,3688,3689],{"class":1124,"line":1847},[1122,3690,3179],{},[1122,3692,3693],{"class":1124,"line":2051},[1122,3694,3147],{},[1122,3696,3697],{"class":1124,"line":2056},[1122,3698,2787],{},[1122,3700,3701],{"class":1124,"line":2061},[1122,3702,3192],{},[1122,3704,3705],{"class":1124,"line":2066},[1122,3706,3197],{},[1122,3708,3709],{"class":1124,"line":2071},[1122,3710,1748],{},[1122,3712,3713],{"class":1124,"line":2076},[1122,3714,1152],{},[1122,3716,3717],{"class":1124,"line":2081},[1122,3718,1759],{"emptyLinePlaceholder":1669},[1122,3720,3721],{"class":1124,"line":2086},[1122,3722,3214],{},[1122,3724,3725],{"class":1124,"line":2091},[1122,3726,3219],{},[1122,3728,3729],{"class":1124,"line":2096},[1122,3730,1134],{},[1122,3732,3733],{"class":1124,"line":2101},[1122,3734,3228],{},[1122,3736,3737],{"class":1124,"line":2106},[1122,3738,1759],{"emptyLinePlaceholder":1669},[1122,3740,3741],{"class":1124,"line":2111},[1122,3742,3237],{},[1122,3744,3745],{"class":1124,"line":2116},[1122,3746,3242],{},[1122,3748,3749],{"class":1124,"line":2121},[1122,3750,3247],{},[1122,3752,3753],{"class":1124,"line":2126},[1122,3754,3252],{},[1122,3756,3757],{"class":1124,"line":2131},[1122,3758,1152],{},[1122,3760,3761],{"class":1124,"line":2136},[1122,3762,1759],{"emptyLinePlaceholder":1669},[1122,3764,3765],{"class":1124,"line":3263},[1122,3766,3266],{},[1122,3768,3769],{"class":1124,"line":3269},[1122,3770,1134],{},[1122,3772,3773],{"class":1124,"line":3274},[1122,3774,3277],{},[1122,3776,3777],{"class":1124,"line":3280},[1122,3778,1759],{"emptyLinePlaceholder":1669},[1122,3780,3781],{"class":1124,"line":3285},[1122,3782,3288],{},[1122,3784,3785],{"class":1124,"line":3291},[1122,3786,1737],{},[1122,3788,3789],{"class":1124,"line":3296},[1122,3790,3299],{},[1122,3792,3793],{"class":1124,"line":3302},[1122,3794,3305],{},[1122,3796,3797],{"class":1124,"line":3308},[1122,3798,1748],{},[1122,3800,3801],{"class":1124,"line":3313},[1122,3802,1759],{"emptyLinePlaceholder":1669},[1122,3804,3805],{"class":1124,"line":3318},[1122,3806,1401],{},[1122,3808,3809],{"class":1124,"line":3323},[1122,3810,1759],{"emptyLinePlaceholder":1669},[1122,3812,3813],{"class":1124,"line":3328},[1122,3814,1776],{},[1122,3816,3817],{"class":1124,"line":3333},[1122,3818,3336],{},[1122,3820,3821],{"class":1124,"line":3339},[1122,3822,1152],{},[1122,3824,3825],{"class":1124,"line":3344},[1122,3826,1759],{"emptyLinePlaceholder":1669},[1122,3828,3829],{"class":1124,"line":3349},[1122,3830,3352],{},[1122,3832,3833],{"class":1124,"line":3355},[1122,3834,1134],{},[1122,3836,3837],{"class":1124,"line":3360},[1122,3838,3363],{},[1122,3840,3841],{"class":1124,"line":3366},[1122,3842,1759],{"emptyLinePlaceholder":1669},[1122,3844,3845],{"class":1124,"line":3371},[1122,3846,1776],{},[1122,3848,3849],{"class":1124,"line":3376},[1122,3850,3379],{},[1122,3852,3853],{"class":1124,"line":3382},[1122,3854,1152],{},[1122,3856,3857],{"class":1124,"line":3387},[1122,3858,1759],{"emptyLinePlaceholder":1669},[1122,3860,3861],{"class":1124,"line":3392},[1122,3862,3395],{},[1122,3864,3865],{"class":1124,"line":3398},[1122,3866,1134],{},[1122,3868,3869],{"class":1124,"line":3403},[1122,3870,3406],{},[1122,3872,3873],{"class":1124,"line":3409},[1122,3874,1759],{"emptyLinePlaceholder":1669},[1122,3876,3877],{"class":1124,"line":3414},[1122,3878,1776],{},[1122,3880,3881],{"class":1124,"line":3419},[1122,3882,3422],{},[1122,3884,3885],{"class":1124,"line":3425},[1122,3886,1152],{},[1122,3888,3889],{"class":1124,"line":3430},[1122,3890,1759],{"emptyLinePlaceholder":1669},[1122,3892,3893],{"class":1124,"line":3435},[1122,3894,3438],{},[1122,3896,3897],{"class":1124,"line":3441},[1122,3898,1134],{},[1122,3900,3901],{"class":1124,"line":3446},[1122,3902,3903],{},"    public static void stopAll(RobotPart[] parts)\n",[1122,3905,3906],{"class":1124,"line":3452},[1122,3907,1737],{},[1122,3909,3911],{"class":1124,"line":3910},80,[1122,3912,3913],{},"        for (RobotPart p : parts)\n",[1122,3915,3917],{"class":1124,"line":3916},81,[1122,3918,2777],{},[1122,3920,3922],{"class":1124,"line":3921},82,[1122,3923,3924],{},"            p.stop();\n",[1122,3926,3928],{"class":1124,"line":3927},83,[1122,3929,2787],{},[1122,3931,3933],{"class":1124,"line":3932},84,[1122,3934,1748],{},[1122,3936,3938],{"class":1124,"line":3937},85,[1122,3939,1759],{"emptyLinePlaceholder":1669},[1122,3941,3943],{"class":1124,"line":3942},86,[1122,3944,3945],{},"    public static int countHolding(RobotPart[] parts)\n",[1122,3947,3949],{"class":1124,"line":3948},87,[1122,3950,1737],{},[1122,3952,3954],{"class":1124,"line":3953},88,[1122,3955,3956],{},"        int holding = 0;\n",[1122,3958,3960],{"class":1124,"line":3959},89,[1122,3961,3913],{},[1122,3963,3965],{"class":1124,"line":3964},90,[1122,3966,2777],{},[1122,3968,3970],{"class":1124,"line":3969},91,[1122,3971,3972],{},"            if (p instanceof Intake i && i.hasGamePiece())\n",[1122,3974,3976],{"class":1124,"line":3975},92,[1122,3977,3137],{},[1122,3979,3981],{"class":1124,"line":3980},93,[1122,3982,3983],{},"                holding++;\n",[1122,3985,3987],{"class":1124,"line":3986},94,[1122,3988,3147],{},[1122,3990,3992],{"class":1124,"line":3991},95,[1122,3993,2787],{},[1122,3995,3997],{"class":1124,"line":3996},96,[1122,3998,3999],{},"        return holding;\n",[1122,4001,4003],{"class":1124,"line":4002},97,[1122,4004,1748],{},[1122,4006,4008],{"class":1124,"line":4007},98,[1122,4009,1152],{},[1085,4011,4012,1566,4014,4017,4018,4020,4021,1415,4023,4025,4026,4028,4029,4031,4032,2167,4034,4037,4038,4041,4042,4044,4045,4047,4048,2439,4050,4053,4054,4056,4057,4059,4060,4062,4063,4066],{},[1088,4013,2433],{},[1097,4015,4016],{},"stopAll"," needs no ",[1097,4019,1308],{}," chain: ",[1097,4022,1085],{},[1097,4024,1354],{},", so the compiler accepts\n",[1097,4027,1300],{},", and at runtime each object's own override runs. ",[1097,4030,2992],{}," exists only on\n",[1097,4033,1350],{},[1097,4035,4036],{},"countHolding"," has to downcast, and the cast has to be guarded. Writing\n",[1097,4039,4040],{},"((Intake) p).hasGamePiece()"," for every element compiles, but throws ",[1097,4043,1449],{}," as soon as\nit reaches a ",[1097,4046,1616],{}," or ",[1097,4049,1619],{},[1097,4051,4052],{},"p instanceof Intake i"," checks the real type first and gives\n",[1097,4055,1489],{}," already typed as ",[1097,4058,1350],{},"; the older form, an ",[1097,4061,1475],{}," test followed by ",[1097,4064,4065],{},"(Intake) p",", works\nthe same way.",[1653,4068,1655],{},{"title":1118,"searchDepth":1131,"depth":1131,"links":4070},[4071,4072,4073],{"id":2330,"depth":1131,"text":2331},{"id":2492,"depth":1131,"text":2493},{"id":2966,"depth":1131,"text":2967},{"outlineRef":1667,"pairsWith":2317,"status":4075},"new — authored exercises (Multiple Choice + Micro-Parsons + Coding)",{"title":984,"description":1118},"HY9GyTNx_5CA8taD4-QPcCrvKqspP5na3VzRPpUVh_8",1792718166152]