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