[{"data":1,"prerenderedAt":2295},["ShallowReactive",2],{"item-lessons-light-ch08-constructors-and-this":3,"item-examples-light-ch08-constructors-and-this":436,"item-exercises-light-ch08-constructors-and-this":597,"item-lesson-full-ch08-constructors-and-this-8.1-8.2":758,"item-example-full-ch08-constructors-and-this-8.1-8.2":1217,"item-exercise-full-ch08-constructors-and-this-8.1-8.2":1899},[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],{"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 & 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\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":85,"title":86,"stem":87},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":89,"title":90,"stem":91},"\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":93,"title":94,"stem":95},"\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":97,"title":98,"stem":99},"\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":101,"title":102,"stem":103},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F8-while-loops","While Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.8-while-loops",{"path":105,"title":106,"stem":107},"\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":109,"title":110,"stem":111},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F1-strings","Strings","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.1-strings",{"path":113,"title":114,"stem":115},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F2-string-algorithms","String Algorithms","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.2-string-algorithms",{"path":117,"title":118,"stem":119},"\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":121,"title":122,"stem":123},"\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":125,"title":126,"stem":127},"\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":129,"title":130,"stem":131},"\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":133,"title":134,"stem":135},"\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":137,"title":138,"stem":139},"\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":141,"title":142,"stem":143},"\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":145,"title":146,"stem":147},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","Optional: HashMap (Dictionary) Data Structure","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":149,"title":150,"stem":151},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":153,"title":154,"stem":155},"\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":157,"title":158,"stem":159},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":161,"title":162,"stem":163},"\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":165,"title":166,"stem":167},"\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":169,"title":170,"stem":171},"\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":173,"title":174,"stem":175},"\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":177,"title":178,"stem":179},"\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":181,"title":182,"stem":183},"\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":185,"title":186,"stem":187},"\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":189,"title":190,"stem":191},"\u002Fshockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas","shockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":193,"title":194,"stem":195},"\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":197,"title":198,"stem":199},"\u002Fshockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap)","shockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":201,"title":202,"stem":203},"\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":205,"title":206,"stem":207},"\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":209,"title":210,"stem":211},"\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":213,"title":214,"stem":215},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":217,"title":218,"stem":219},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":221,"title":222,"stem":223},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":225,"title":226,"stem":227},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":229,"title":230,"stem":231},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":233,"title":234,"stem":235},"\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":237,"title":238,"stem":239},"\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":241,"title":242,"stem":243},"\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":245,"title":246,"stem":247},"\u002Fshockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories","Static Factories","shockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories",{"path":249,"title":250,"stem":251},"\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":253,"title":254,"stem":255},"\u002Fshockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Scope and Access","shockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":257,"title":258,"stem":259},"\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":261,"title":262,"stem":263},"\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":265,"title":266,"stem":267},"\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":269,"title":270,"stem":271},"\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":273,"title":274,"stem":275},"\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":277,"title":278,"stem":279},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":281,"title":282,"stem":283},"\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":285,"title":286,"stem":287},"\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":289,"title":290,"stem":291},"\u002Fshockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways","shockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":293,"title":294,"stem":295},"\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":297,"title":298,"stem":299},"\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":301,"title":302,"stem":303},"\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":305,"title":306,"stem":307},"\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":309,"title":310,"stem":311},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":313,"title":314,"stem":315},"\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":317,"title":318,"stem":319},"\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":321,"title":322,"stem":323},"\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":325,"title":326,"stem":327},"\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":329,"title":330,"stem":331},"\u002Fshockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F1-coming-soon","Unit Testing — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F32.1-coming-soon",{"path":333,"title":334,"stem":335},"\u002Fshockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F1-coming-soon","AdvantageKit — AutoLogging — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F33.1-coming-soon",{"path":337,"title":338,"stem":339},"\u002Fshockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F1-coming-soon","Log Replay — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F34.1-coming-soon",{"path":341,"title":342,"stem":343},"\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":345,"title":346,"stem":347},"\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":349,"title":350,"stem":351},"\u002Fshockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F1-coming-soon","Autonomous I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F37.1-coming-soon",{"path":353,"title":354,"stem":355},"\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":357,"title":358,"stem":359},"\u002Fshockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F1-coming-soon","Control Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F39.1-coming-soon",{"path":361,"title":362,"stem":363},"\u002Fshockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F1-coming-soon","Motion Profiles — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F40.1-coming-soon",{"path":365,"title":366,"stem":367},"\u002Fshockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F1-coming-soon","Hardware Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F41.1-coming-soon",{"path":369,"title":370,"stem":371},"\u002Fshockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F1-coming-soon","PhotonVision — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F42.1-coming-soon",{"path":373,"title":374,"stem":375},"\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":377,"title":378,"stem":379},"\u002Fshockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F1-coming-soon","Subsystems I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F44.1-coming-soon",{"path":381,"title":382,"stem":383},"\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":385,"title":386,"stem":387},"\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":389,"title":390,"stem":391},"\u002Fshockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F1-coming-soon","Field Constants — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F47.1-coming-soon",{"path":393,"title":394,"stem":395},"\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":397,"title":398,"stem":399},"\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":401,"title":402,"stem":403},"\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":405,"title":406,"stem":407},"\u002Fshockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F1-coming-soon","Robot Alerts — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F51.1-coming-soon",{"path":409,"title":410,"stem":411},"\u002Fshockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F1-coming-soon","WPILib Commands — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F52.1-coming-soon",{"path":413,"title":414,"stem":415},"\u002Fshockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F1-coming-soon","WPILib Geometry — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F53.1-coming-soon",{"path":417,"title":418,"stem":419},"\u002Fshockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F1-coming-soon","NetworkTables — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F54.1-coming-soon",{"path":421,"title":422,"stem":423},"\u002Fshockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F1-coming-soon","Command Scheduler — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F55.1-coming-soon",{"path":425,"title":426,"stem":427},"\u002Fshockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F1-coming-soon","WPILib Timers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F56.1-coming-soon",{"path":429,"title":430,"stem":431},"\u002Fshockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F1-coming-soon","WPILib Triggers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F57.1-coming-soon",{"path":433,"title":434,"stem":435},"\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",[437,441,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],{"path":438,"title":439,"stem":440},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming & Compilers — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":442,"title":443,"stem":444},"\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":446,"title":447,"stem":448},"\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":450,"title":451,"stem":452},"\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":454,"title":455,"stem":456},"\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":458,"title":459,"stem":460},"\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":462,"title":463,"stem":464},"\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":466,"title":467,"stem":468},"\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":470,"title":471,"stem":472},"\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":474,"title":475,"stem":476},"\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":478,"title":479,"stem":480},"\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":482,"title":483,"stem":484},"\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":486,"title":487,"stem":488},"\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":490,"title":491,"stem":492},"\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":494,"title":495,"stem":496},"\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":498,"title":499,"stem":500},"\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":502,"title":503,"stem":504},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":506,"title":507,"stem":508},"\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":510,"title":511,"stem":512},"\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":514,"title":515,"stem":516},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":518,"title":519,"stem":520},"\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":522,"title":523,"stem":524},"\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":526,"title":527,"stem":528},"\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":530,"title":531,"stem":532},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F8-while-loops","While Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.8-while-loops",{"path":534,"title":535,"stem":536},"\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":538,"title":539,"stem":540},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F1-strings","Strings — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.1-strings",{"path":542,"title":543,"stem":544},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.2-string-algorithms",{"path":546,"title":547,"stem":548},"\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":550,"title":551,"stem":552},"\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":554,"title":555,"stem":556},"\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":558,"title":559,"stem":560},"\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":562,"title":563,"stem":564},"\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":566,"title":567,"stem":568},"\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":570,"title":571,"stem":572},"\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":574,"title":575,"stem":576},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","Optional: HashMap (Dictionary) Data Structure — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":578,"title":579,"stem":580},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":582,"title":583,"stem":584},"\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":586,"title":587,"stem":588},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":590,"title":591,"stem":592},"\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":594,"title":595,"stem":596},"\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",[598,602,606,610,614,618,622,626,630,634,638,642,646,650,654,658,662,666,670,674,678,682,686,690,694,698,702,706,710,714,718,722,726,730,734,738,742,746,750,754],{"path":599,"title":600,"stem":601},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming & Compilers — Exercises","shockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":603,"title":604,"stem":605},"\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":607,"title":608,"stem":609},"\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":611,"title":612,"stem":613},"\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":615,"title":616,"stem":617},"\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":619,"title":620,"stem":621},"\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":623,"title":624,"stem":625},"\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":627,"title":628,"stem":629},"\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":631,"title":632,"stem":633},"\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":635,"title":636,"stem":637},"\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":639,"title":640,"stem":641},"\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":643,"title":644,"stem":645},"\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":647,"title":648,"stem":649},"\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":651,"title":652,"stem":653},"\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":655,"title":656,"stem":657},"\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":659,"title":660,"stem":661},"\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":663,"title":664,"stem":665},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":667,"title":668,"stem":669},"\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":671,"title":672,"stem":673},"\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":675,"title":676,"stem":677},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":679,"title":680,"stem":681},"\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":683,"title":684,"stem":685},"\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":687,"title":688,"stem":689},"\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":691,"title":692,"stem":693},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F8-while-loops","While Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.8-while-loops",{"path":695,"title":696,"stem":697},"\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":699,"title":700,"stem":701},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F1-strings","Strings — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.1-strings",{"path":703,"title":704,"stem":705},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.2-string-algorithms",{"path":707,"title":708,"stem":709},"\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":711,"title":712,"stem":713},"\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":715,"title":716,"stem":717},"\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":719,"title":720,"stem":721},"\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":723,"title":724,"stem":725},"\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":727,"title":728,"stem":729},"\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":731,"title":732,"stem":733},"\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":735,"title":736,"stem":737},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","Optional: HashMap (Dictionary) Data Structure — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":739,"title":740,"stem":741},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":743,"title":744,"stem":745},"\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":747,"title":748,"stem":749},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":751,"title":752,"stem":753},"\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":755,"title":756,"stem":757},"\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",{"id":759,"title":134,"body":760,"description":792,"extension":1211,"meta":1212,"navigation":820,"path":133,"seo":1215,"stem":135,"__hash__":1216},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this.md",{"type":761,"value":762,"toc":1200},"minimark",[763,767,772,786,852,856,883,905,909,916,1002,1009,1026,1049,1058,1070,1076,1081,1125,1129,1159,1163,1187,1196],[764,765,134],"h1",{"id":766},"constructors-this",[768,769,771],"h2",{"id":770},"a-constructors-job","A Constructor's Job",[773,774,775,776,780,781,785],"p",{},"A constructor's only job is to put a new object into a ",[777,778,779],"strong",{},"valid state"," — every instance variable set to something usable. Its signature looks like a method's, but with two differences: no return type (not even ",[782,783,784],"code",{},"void","), and its name is always exactly the class's name.",[787,788,793],"pre",{"className":789,"code":790,"language":791,"meta":792,"style":792},"language-java shiki shiki-themes github-light github-dark","public class Climber\n{\n    private int motorPort;\n\n    public Climber(int motorPort) \u002F\u002F same name as the class, no return type\n    {\n        this.motorPort = motorPort;\n    }\n}\n","java","",[782,794,795,803,809,815,822,828,834,840,846],{"__ignoreMap":792},[796,797,800],"span",{"class":798,"line":799},"line",1,[796,801,802],{},"public class Climber\n",[796,804,806],{"class":798,"line":805},2,[796,807,808],{},"{\n",[796,810,812],{"class":798,"line":811},3,[796,813,814],{},"    private int motorPort;\n",[796,816,818],{"class":798,"line":817},4,[796,819,821],{"emptyLinePlaceholder":820},true,"\n",[796,823,825],{"class":798,"line":824},5,[796,826,827],{},"    public Climber(int motorPort) \u002F\u002F same name as the class, no return type\n",[796,829,831],{"class":798,"line":830},6,[796,832,833],{},"    {\n",[796,835,837],{"class":798,"line":836},7,[796,838,839],{},"        this.motorPort = motorPort;\n",[796,841,843],{"class":798,"line":842},8,[796,844,845],{},"    }\n",[796,847,849],{"class":798,"line":848},9,[796,850,851],{},"}\n",[768,853,855],{"id":854},"the-default-constructor","The Default Constructor",[773,857,858,859,862,863,866,867,862,870,866,873,862,876,866,879,882],{},"If you don't write any constructor at all, Java gives your class a free no-argument one that sets every instance variable to its type's default (",[782,860,861],{},"0"," for ",[782,864,865],{},"int",", ",[782,868,869],{},"0.0",[782,871,872],{},"double",[782,874,875],{},"false",[782,877,878],{},"boolean",[782,880,881],{},"null"," for any reference type). The moment you write even one constructor yourself, that free one disappears — you have to cover every way you want objects of your class to be built.",[787,884,886],{"className":789,"code":885,"language":791,"meta":792,"style":792},"public class Climber\n{\n    private int motorPort; \u002F\u002F if no constructor is written, this defaults to 0\n}\n",[782,887,888,892,896,901],{"__ignoreMap":792},[796,889,890],{"class":798,"line":799},[796,891,802],{},[796,893,894],{"class":798,"line":805},[796,895,808],{},[796,897,898],{"class":798,"line":811},[796,899,900],{},"    private int motorPort; \u002F\u002F if no constructor is written, this defaults to 0\n",[796,902,903],{"class":798,"line":817},[796,904,851],{},[768,906,908],{"id":907},"overloaded-constructors","Overloaded Constructors",[773,910,911,912,915],{},"Just like methods (Ch.4.1), a class can have several constructors, distinguished by their parameter lists — this is the same ",[777,913,914],{},"overloading"," concept:",[787,917,919],{"className":789,"code":918,"language":791,"meta":792,"style":792},"public class Climber\n{\n    private int motorPort;\n    private double climbSpeed;\n\n    public Climber(int motorPort)\n    {\n        this.motorPort = motorPort;\n        this.climbSpeed = 0.5; \u002F\u002F a sensible default\n    }\n\n    public Climber(int motorPort, double climbSpeed)\n    {\n        this.motorPort = motorPort;\n        this.climbSpeed = climbSpeed;\n    }\n}\n",[782,920,921,925,929,933,938,942,947,951,955,960,965,970,976,981,986,992,997],{"__ignoreMap":792},[796,922,923],{"class":798,"line":799},[796,924,802],{},[796,926,927],{"class":798,"line":805},[796,928,808],{},[796,930,931],{"class":798,"line":811},[796,932,814],{},[796,934,935],{"class":798,"line":817},[796,936,937],{},"    private double climbSpeed;\n",[796,939,940],{"class":798,"line":824},[796,941,821],{"emptyLinePlaceholder":820},[796,943,944],{"class":798,"line":830},[796,945,946],{},"    public Climber(int motorPort)\n",[796,948,949],{"class":798,"line":836},[796,950,833],{},[796,952,953],{"class":798,"line":842},[796,954,839],{},[796,956,957],{"class":798,"line":848},[796,958,959],{},"        this.climbSpeed = 0.5; \u002F\u002F a sensible default\n",[796,961,963],{"class":798,"line":962},10,[796,964,845],{},[796,966,968],{"class":798,"line":967},11,[796,969,821],{"emptyLinePlaceholder":820},[796,971,973],{"class":798,"line":972},12,[796,974,975],{},"    public Climber(int motorPort, double climbSpeed)\n",[796,977,979],{"class":798,"line":978},13,[796,980,833],{},[796,982,984],{"class":798,"line":983},14,[796,985,839],{},[796,987,989],{"class":798,"line":988},15,[796,990,991],{},"        this.climbSpeed = climbSpeed;\n",[796,993,995],{"class":798,"line":994},16,[796,996,845],{},[796,998,1000],{"class":798,"line":999},17,[796,1001,851],{},[768,1003,1005,1008],{"id":1004},"this-referring-to-the-current-object",[782,1006,1007],{},"this",": Referring to the Current Object",[773,1010,1011,1012,1014,1015,1018,1019,1022,1023,1025],{},"Inside an instance method or constructor, ",[782,1013,1007],{}," refers to the specific object the method\u002Fconstructor is currently running for. It's most useful when a parameter shares a name with an instance variable — ",[782,1016,1017],{},"this.motorPort"," unambiguously means \"this object's ",[782,1020,1021],{},"motorPort",",\" while bare ",[782,1024,1021],{}," means the parameter:",[787,1027,1029],{"className":789,"code":1028,"language":791,"meta":792,"style":792},"public Climber(int motorPort)\n{\n    this.motorPort = motorPort; \u002F\u002F left side: instance variable. right side: parameter.\n}\n",[782,1030,1031,1036,1040,1045],{"__ignoreMap":792},[796,1032,1033],{"class":798,"line":799},[796,1034,1035],{},"public Climber(int motorPort)\n",[796,1037,1038],{"class":798,"line":805},[796,1039,808],{},[796,1041,1042],{"class":798,"line":811},[796,1043,1044],{},"    this.motorPort = motorPort; \u002F\u002F left side: instance variable. right side: parameter.\n",[796,1046,1047],{"class":798,"line":817},[796,1048,851],{},[773,1050,1051,1052,866,1054,1057],{},"Without ",[782,1053,1007],{},[782,1055,1056],{},"motorPort = motorPort;"," would just assign the parameter to itself — the instance variable would never actually get set.",[773,1059,1060,1062,1063,1066,1067,1069],{},[782,1061,1007],{}," only exists inside instance methods and constructors — a ",[782,1064,1065],{},"static"," method has no current object to refer to, so it has no ",[782,1068,1007],{}," (Ch.7.4).",[768,1071,1073,1075],{"id":1072},"this-as-an-argument",[782,1074,1007],{}," as an Argument",[773,1077,1078,1080],{},[782,1079,1007],{}," is a real reference, usable anywhere an object reference is expected — including passing the current object into another method or constructor:",[787,1082,1084],{"className":789,"code":1083,"language":791,"meta":792,"style":792},"public class Climber\n{\n    private double currentHeight;\n\n    public void reportTo(ClimbLogger logger)\n    {\n        logger.record(this); \u002F\u002F pass the current Climber object itself\n    }\n}\n",[782,1085,1086,1090,1094,1099,1103,1108,1112,1117,1121],{"__ignoreMap":792},[796,1087,1088],{"class":798,"line":799},[796,1089,802],{},[796,1091,1092],{"class":798,"line":805},[796,1093,808],{},[796,1095,1096],{"class":798,"line":811},[796,1097,1098],{},"    private double currentHeight;\n",[796,1100,1101],{"class":798,"line":817},[796,1102,821],{"emptyLinePlaceholder":820},[796,1104,1105],{"class":798,"line":824},[796,1106,1107],{},"    public void reportTo(ClimbLogger logger)\n",[796,1109,1110],{"class":798,"line":830},[796,1111,833],{},[796,1113,1114],{"class":798,"line":836},[796,1115,1116],{},"        logger.record(this); \u002F\u002F pass the current Climber object itself\n",[796,1118,1119],{"class":798,"line":842},[796,1120,845],{},[796,1122,1123],{"class":798,"line":848},[796,1124,851],{},[768,1126,1128],{"id":1127},"common-pitfalls","Common Pitfalls",[1130,1131,1132,1148],"ul",{},[1133,1134,1135,1141,1142,1144,1145,1147],"li",{},[777,1136,1137,1138,1140],{},"Forgetting ",[782,1139,1007],{}," when a parameter shadows an instance variable."," ",[782,1143,1056],{}," (no ",[782,1146,1007],{},") does nothing useful — it assigns the parameter to itself, leaving the actual instance variable untouched.",[1133,1149,1150,1153,1154,1158],{},[777,1151,1152],{},"Assuming a class always gets a free default constructor."," Only true if you write ",[1155,1156,1157],"em",{},"zero"," constructors yourself. Write even one, and you're responsible for every constructor your class needs.",[768,1160,1162],{"id":1161},"key-takeaways","Key Takeaways",[1130,1164,1165,1168,1171,1174,1179],{},[1133,1166,1167],{},"A constructor's signature has no return type and always matches the class's name; its job is to leave the object in a valid state.",[1133,1169,1170],{},"With no constructor written, Java provides a default one that zeroes\u002Fnulls every instance variable — writing any constructor yourself removes that default.",[1133,1172,1173],{},"Constructors can be overloaded, just like methods, distinguished by parameter lists.",[1133,1175,1176,1178],{},[782,1177,1007],{}," refers to the current object inside an instance method or constructor — essential for disambiguating a parameter from an instance variable of the same name.",[1133,1180,1181,1183,1184,1186],{},[782,1182,1007],{}," can be passed as an argument, like any other object reference. Static methods have no ",[782,1185,1007],{},".",[773,1188,1189,1141,1192,1195],{},[777,1190,1191],{},"Deck context:",[782,1193,1194],{},"mechacoder-test\u002Fsrc\u002Flessons\u002Fjava-1.js",", slide 8 (\"CONSTRUCTORS\")",[1197,1198,1199],"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":792,"searchDepth":805,"depth":805,"links":1201},[1202,1203,1204,1205,1207,1209,1210],{"id":770,"depth":805,"text":771},{"id":854,"depth":805,"text":855},{"id":907,"depth":805,"text":908},{"id":1004,"depth":805,"text":1206},"this: Referring to the Current Object",{"id":1072,"depth":805,"text":1208},"this as an Argument",{"id":1127,"depth":805,"text":1128},{"id":1161,"depth":805,"text":1162},"md",{"outlineRef":1213,"status":1214},"8.1 (Writing Constructors, CSA 3.4) + 8.2 (this Keyword, CSA 3.9) — combined","new — authored lesson (fuller depth than the teaser slide). This single lesson covers both items together, matching the existing deck slide's combined granularity.",{"title":134,"description":792},"-3qv80WFPOtmH728hukb9Itvv2JdIpc3usPyTrZSRDM",{"id":1218,"title":563,"body":1219,"description":792,"extension":1211,"meta":1894,"navigation":820,"path":562,"seo":1897,"stem":564,"__hash__":1898},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this.md",{"type":761,"value":1220,"toc":1880},[1221,1224,1228,1240,1244,1247,1274,1293,1297,1309,1360,1374,1378,1384,1460,1463,1470,1593,1636,1640,1648,1659,1666,1674,1719,1725,1734,1769,1772,1778,1785,1790,1818,1844,1848,1878],[764,1222,563],{"id":1223},"constructors-this-worked-example",[768,1225,1227],{"id":1226},"problem","Problem",[773,1229,1230,1231,1233,1234,1237,1238,1186],{},"Model a single drivetrain motor for a robot. It needs a ",[782,1232,1021],{}," and a ",[782,1235,1236],{},"speed",". Teammates should be able to build a motor by specifying both the port and a starting speed, or by specifying just the port — in which case the motor starts stopped, at speed ",[782,1239,869],{},[768,1241,1243],{"id":1242},"step-1-sketch-the-class-and-its-fields","Step 1: Sketch the Class and Its Fields",[773,1245,1246],{},"Start with just the instance variables — no constructor yet:",[787,1248,1250],{"className":789,"code":1249,"language":791,"meta":792,"style":792},"public class DriveMotor\n{\n    private int motorPort;\n    private double speed;\n}\n",[782,1251,1252,1257,1261,1265,1270],{"__ignoreMap":792},[796,1253,1254],{"class":798,"line":799},[796,1255,1256],{},"public class DriveMotor\n",[796,1258,1259],{"class":798,"line":805},[796,1260,808],{},[796,1262,1263],{"class":798,"line":811},[796,1264,814],{},[796,1266,1267],{"class":798,"line":817},[796,1268,1269],{},"    private double speed;\n",[796,1271,1272],{"class":798,"line":824},[796,1273,851],{},[773,1275,1276,1277,1279,1280,1282,1283,1279,1285,1287,1288,1282,1290,1292],{},"Right now, this class has no constructor written at all, so Java hands it a free no-argument one behind the scenes: it sets ",[782,1278,1021],{}," to ",[782,1281,861],{}," and ",[782,1284,1236],{},[782,1286,869],{},", the defaults for ",[782,1289,865],{},[782,1291,872],{},". That's not useful here — a motor with no known port isn't in a valid state — so the next steps replace it.",[768,1294,1296],{"id":1295},"step-2-write-the-two-argument-constructor","Step 2: Write the Two-Argument Constructor",[773,1298,1299,1300,1302,1303,1305,1306,1308],{},"A constructor's job is to leave the object in a valid state. This one takes both values a motor needs and assigns them. Naming the parameters the same as the instance variables makes the constructor read clearly — the tradeoff is that ",[782,1301,1021],{}," (the parameter) now shadows ",[782,1304,1021],{}," (the instance variable), so ",[782,1307,1007],{}," is required to reach the instance variable:",[787,1310,1312],{"className":789,"code":1311,"language":791,"meta":792,"style":792},"public class DriveMotor\n{\n    private int motorPort;\n    private double speed;\n\n    public DriveMotor(int motorPort, double speed) \u002F\u002F same name as the class, no return type\n    {\n        this.motorPort = motorPort;\n        this.speed = speed;\n    }\n}\n",[782,1313,1314,1318,1322,1326,1330,1334,1339,1343,1347,1352,1356],{"__ignoreMap":792},[796,1315,1316],{"class":798,"line":799},[796,1317,1256],{},[796,1319,1320],{"class":798,"line":805},[796,1321,808],{},[796,1323,1324],{"class":798,"line":811},[796,1325,814],{},[796,1327,1328],{"class":798,"line":817},[796,1329,1269],{},[796,1331,1332],{"class":798,"line":824},[796,1333,821],{"emptyLinePlaceholder":820},[796,1335,1336],{"class":798,"line":830},[796,1337,1338],{},"    public DriveMotor(int motorPort, double speed) \u002F\u002F same name as the class, no return type\n",[796,1340,1341],{"class":798,"line":836},[796,1342,833],{},[796,1344,1345],{"class":798,"line":842},[796,1346,839],{},[796,1348,1349],{"class":798,"line":848},[796,1350,1351],{},"        this.speed = speed;\n",[796,1353,1354],{"class":798,"line":962},[796,1355,845],{},[796,1357,1358],{"class":798,"line":967},[796,1359,851],{},[773,1361,1362,1018,1364,1366,1367,1369,1370,1373],{},[782,1363,1017],{},[782,1365,1021],{},"\"; the bare ",[782,1368,1021],{}," on the right is the parameter. The moment this constructor exists, the free default constructor from Step 1 is gone — ",[782,1371,1372],{},"DriveMotor"," now only builds the way this constructor says it can.",[768,1375,1377],{"id":1376},"step-3-add-an-overloaded-constructor-for-a-default-speed","Step 3: Add an Overloaded Constructor for a Default Speed",[773,1379,1380,1381,1383],{},"A teammate building a motor that should just start stopped shouldn't have to type ",[782,1382,869],{}," every time. Add a second constructor, distinguished by its parameter list — the same overloading concept as overloaded methods (Ch.4.1):",[787,1385,1387],{"className":789,"code":1386,"language":791,"meta":792,"style":792},"public class DriveMotor\n{\n    private int motorPort;\n    private double speed;\n\n    public DriveMotor(int motorPort, double speed)\n    {\n        this.motorPort = motorPort;\n        this.speed = speed;\n    }\n\n    public DriveMotor(int motorPort)\n    {\n        this.motorPort = motorPort;\n        this.speed = 0.0; \u002F\u002F sensible default: starts stopped\n    }\n}\n",[782,1388,1389,1393,1397,1401,1405,1409,1414,1418,1422,1426,1430,1434,1439,1443,1447,1452,1456],{"__ignoreMap":792},[796,1390,1391],{"class":798,"line":799},[796,1392,1256],{},[796,1394,1395],{"class":798,"line":805},[796,1396,808],{},[796,1398,1399],{"class":798,"line":811},[796,1400,814],{},[796,1402,1403],{"class":798,"line":817},[796,1404,1269],{},[796,1406,1407],{"class":798,"line":824},[796,1408,821],{"emptyLinePlaceholder":820},[796,1410,1411],{"class":798,"line":830},[796,1412,1413],{},"    public DriveMotor(int motorPort, double speed)\n",[796,1415,1416],{"class":798,"line":836},[796,1417,833],{},[796,1419,1420],{"class":798,"line":842},[796,1421,839],{},[796,1423,1424],{"class":798,"line":848},[796,1425,1351],{},[796,1427,1428],{"class":798,"line":962},[796,1429,845],{},[796,1431,1432],{"class":798,"line":967},[796,1433,821],{"emptyLinePlaceholder":820},[796,1435,1436],{"class":798,"line":972},[796,1437,1438],{},"    public DriveMotor(int motorPort)\n",[796,1440,1441],{"class":798,"line":978},[796,1442,833],{},[796,1444,1445],{"class":798,"line":983},[796,1446,839],{},[796,1448,1449],{"class":798,"line":988},[796,1450,1451],{},"        this.speed = 0.0; \u002F\u002F sensible default: starts stopped\n",[796,1453,1454],{"class":798,"line":994},[796,1455,845],{},[796,1457,1458],{"class":798,"line":999},[796,1459,851],{},[773,1461,1462],{},"Both constructors leave the object in a valid state — they just differ in how much the caller has to supply.",[768,1464,1466,1467],{"id":1465},"step-4-put-it-together-in-main","Step 4: Put It Together in ",[782,1468,1469],{},"main",[787,1471,1473],{"className":789,"code":1472,"language":791,"meta":792,"style":792},"public class DriveMotor\n{\n    private int motorPort;\n    private double speed;\n\n    public DriveMotor(int motorPort, double speed)\n    {\n        this.motorPort = motorPort;\n        this.speed = speed;\n    }\n\n    public DriveMotor(int motorPort)\n    {\n        this.motorPort = motorPort;\n        this.speed = 0.0; \u002F\u002F sensible default: starts stopped\n    }\n\n    public static void main(String[] args)\n    {\n        DriveMotor leftDrive = new DriveMotor(3, 0.8);   \u002F\u002F port 3, starts at 0.8\n        DriveMotor rightDrive = new DriveMotor(5);        \u002F\u002F port 5, starts stopped\n\n        System.out.println(\"Left drive  - port: \" + leftDrive.motorPort + \", speed: \" + leftDrive.speed);\n        System.out.println(\"Right drive - port: \" + rightDrive.motorPort + \", speed: \" + rightDrive.speed);\n    }\n}\n",[782,1474,1475,1479,1483,1487,1491,1495,1499,1503,1507,1511,1515,1519,1523,1527,1531,1535,1539,1543,1549,1554,1560,1566,1571,1577,1583,1588],{"__ignoreMap":792},[796,1476,1477],{"class":798,"line":799},[796,1478,1256],{},[796,1480,1481],{"class":798,"line":805},[796,1482,808],{},[796,1484,1485],{"class":798,"line":811},[796,1486,814],{},[796,1488,1489],{"class":798,"line":817},[796,1490,1269],{},[796,1492,1493],{"class":798,"line":824},[796,1494,821],{"emptyLinePlaceholder":820},[796,1496,1497],{"class":798,"line":830},[796,1498,1413],{},[796,1500,1501],{"class":798,"line":836},[796,1502,833],{},[796,1504,1505],{"class":798,"line":842},[796,1506,839],{},[796,1508,1509],{"class":798,"line":848},[796,1510,1351],{},[796,1512,1513],{"class":798,"line":962},[796,1514,845],{},[796,1516,1517],{"class":798,"line":967},[796,1518,821],{"emptyLinePlaceholder":820},[796,1520,1521],{"class":798,"line":972},[796,1522,1438],{},[796,1524,1525],{"class":798,"line":978},[796,1526,833],{},[796,1528,1529],{"class":798,"line":983},[796,1530,839],{},[796,1532,1533],{"class":798,"line":988},[796,1534,1451],{},[796,1536,1537],{"class":798,"line":994},[796,1538,845],{},[796,1540,1541],{"class":798,"line":999},[796,1542,821],{"emptyLinePlaceholder":820},[796,1544,1546],{"class":798,"line":1545},18,[796,1547,1548],{},"    public static void main(String[] args)\n",[796,1550,1552],{"class":798,"line":1551},19,[796,1553,833],{},[796,1555,1557],{"class":798,"line":1556},20,[796,1558,1559],{},"        DriveMotor leftDrive = new DriveMotor(3, 0.8);   \u002F\u002F port 3, starts at 0.8\n",[796,1561,1563],{"class":798,"line":1562},21,[796,1564,1565],{},"        DriveMotor rightDrive = new DriveMotor(5);        \u002F\u002F port 5, starts stopped\n",[796,1567,1569],{"class":798,"line":1568},22,[796,1570,821],{"emptyLinePlaceholder":820},[796,1572,1574],{"class":798,"line":1573},23,[796,1575,1576],{},"        System.out.println(\"Left drive  - port: \" + leftDrive.motorPort + \", speed: \" + leftDrive.speed);\n",[796,1578,1580],{"class":798,"line":1579},24,[796,1581,1582],{},"        System.out.println(\"Right drive - port: \" + rightDrive.motorPort + \", speed: \" + rightDrive.speed);\n",[796,1584,1586],{"class":798,"line":1585},25,[796,1587,845],{},[796,1589,1591],{"class":798,"line":1590},26,[796,1592,851],{},[773,1594,1595,1598,1599,1602,1603,1606,1607,1609,1610,1282,1612,1614,1615,1618,1619,1621,1622,1625,1626,1629,1630,1632,1633,1635],{},[782,1596,1597],{},"leftDrive"," is built with the two-argument constructor from Step 2; ",[782,1600,1601],{},"rightDrive"," is built with the one-argument constructor from Step 3. Java picks which constructor runs by matching the argument list at the ",[782,1604,1605],{},"new"," call — that's overload resolution, the same as for methods. ",[782,1608,1469],{}," can read ",[782,1611,1021],{},[782,1613,1236],{}," straight off either object even though both fields are ",[782,1616,1617],{},"private",": ",[782,1620,1617],{}," hides a field from ",[1155,1623,1624],{},"other"," classes, not from other methods of the ",[1155,1627,1628],{},"same"," class, and this ",[782,1631,1469],{}," lives inside ",[782,1634,1372],{}," itself.",[768,1637,1639],{"id":1638},"what-it-prints","What It Prints",[787,1641,1646],{"className":1642,"code":1644,"language":1645},[1643],"language-text","Left drive  - port: 3, speed: 0.8\nRight drive - port: 5, speed: 0.0\n","text",[782,1647,1644],{"__ignoreMap":792},[773,1649,1650,1652,1653,1655,1656,1658],{},[782,1651,1601],{}," never had a speed passed in, so its ",[782,1654,1236],{}," shows the ",[782,1657,869],{}," default from Step 3 instead.",[768,1660,1662,1663,1665],{"id":1661},"step-5-pass-this-to-another-method","Step 5: Pass ",[782,1664,1007],{}," to Another Method",[773,1667,1668,1670,1671,1673],{},[782,1669,1007],{}," isn't just for disambiguating fields — it's a full reference to the current object, so it can be passed anywhere an object of that type is expected, like any other argument. Add one static method that logs any ",[782,1672,1372],{},", and one instance method that hands itself over:",[787,1675,1677],{"className":789,"code":1676,"language":791,"meta":792,"style":792},"public static void logStatus(DriveMotor motor)\n{\n    System.out.println(\"[LOG] port \" + motor.motorPort + \", speed \" + motor.speed);\n}\n\npublic void reportStatus()\n{\n    logStatus(this); \u002F\u002F pass the current object itself\n}\n",[782,1678,1679,1684,1688,1693,1697,1701,1706,1710,1715],{"__ignoreMap":792},[796,1680,1681],{"class":798,"line":799},[796,1682,1683],{},"public static void logStatus(DriveMotor motor)\n",[796,1685,1686],{"class":798,"line":805},[796,1687,808],{},[796,1689,1690],{"class":798,"line":811},[796,1691,1692],{},"    System.out.println(\"[LOG] port \" + motor.motorPort + \", speed \" + motor.speed);\n",[796,1694,1695],{"class":798,"line":817},[796,1696,851],{},[796,1698,1699],{"class":798,"line":824},[796,1700,821],{"emptyLinePlaceholder":820},[796,1702,1703],{"class":798,"line":830},[796,1704,1705],{},"public void reportStatus()\n",[796,1707,1708],{"class":798,"line":836},[796,1709,808],{},[796,1711,1712],{"class":798,"line":842},[796,1713,1714],{},"    logStatus(this); \u002F\u002F pass the current object itself\n",[796,1716,1717],{"class":798,"line":848},[796,1718,851],{},[773,1720,1721,1722,1724],{},"Then call it from ",[782,1723,1469],{},":",[787,1726,1728],{"className":789,"code":1727,"language":791,"meta":792,"style":792},"leftDrive.reportStatus();\n",[782,1729,1730],{"__ignoreMap":792},[796,1731,1732],{"class":798,"line":799},[796,1733,1727],{},[773,1735,1736,1739,1740,1742,1743,1745,1746,1748,1749,1752,1753,1282,1756,1759,1760,1762,1763,1765,1766,1768],{},[782,1737,1738],{},"reportStatus()"," doesn't build a new ",[782,1741,1372],{}," or know its own port\u002Fspeed by name — it just hands ",[782,1744,1007],{}," (whichever ",[782,1747,1372],{}," it was called on) to ",[782,1750,1751],{},"logStatus",", which reads ",[782,1754,1755],{},"motor.motorPort",[782,1757,1758],{},"motor.speed"," off whatever object it was given. ",[782,1761,1751],{}," is ",[782,1764,1065],{},", so it has no ",[782,1767,1007],{}," of its own — it only knows about the motor because one was passed in.",[773,1770,1771],{},"Output adds one line:",[787,1773,1776],{"className":1774,"code":1775,"language":1645},[1643],"[LOG] port 3, speed 0.8\n",[782,1777,1775],{"__ignoreMap":792},[768,1779,1781,1782,1784],{"id":1780},"what-forgetting-this-would-look-like","What Forgetting ",[782,1783,1007],{}," Would Look Like",[773,1786,1787,1788,1724],{},"If Step 2's constructor had been written without ",[782,1789,1007],{},[787,1791,1793],{"className":789,"code":1792,"language":791,"meta":792,"style":792},"public DriveMotor(int motorPort, double speed)\n{\n    motorPort = motorPort; \u002F\u002F bug: parameter assigned to itself\n    speed = speed;         \u002F\u002F bug: parameter assigned to itself\n}\n",[782,1794,1795,1800,1804,1809,1814],{"__ignoreMap":792},[796,1796,1797],{"class":798,"line":799},[796,1798,1799],{},"public DriveMotor(int motorPort, double speed)\n",[796,1801,1802],{"class":798,"line":805},[796,1803,808],{},[796,1805,1806],{"class":798,"line":811},[796,1807,1808],{},"    motorPort = motorPort; \u002F\u002F bug: parameter assigned to itself\n",[796,1810,1811],{"class":798,"line":817},[796,1812,1813],{},"    speed = speed;         \u002F\u002F bug: parameter assigned to itself\n",[796,1815,1816],{"class":798,"line":824},[796,1817,851],{},[773,1819,1820,1821,1282,1823,1825,1826,1828,1829,1831,1832,1834,1835,1837,1838,1840,1841,1843],{},"Both lines compile — ",[782,1822,1021],{},[782,1824,1236],{}," are valid names on both sides. But without ",[782,1827,1007],{},", the compiler always means the closest name in scope, which is the parameter. ",[782,1830,1056],{}," just assigns the parameter to itself; the instance variable ",[782,1833,1021],{}," never gets touched and stays at its default, ",[782,1836,861],{},". Every ",[782,1839,1372],{}," built this way would silently think it's on port ",[782,1842,861],{},", no matter what the caller passed in — and nothing about it would look wrong until the robot tried to drive the wrong motor.",[768,1845,1847],{"id":1846},"recap","Recap",[1130,1849,1850,1852,1854,1856,1860,1866],{},[1133,1851,1167],{},[1133,1853,1170],{},[1133,1855,1173],{},[1133,1857,1858,1178],{},[782,1859,1007],{},[1133,1861,1862,1863,1865],{},"Java picks which overloaded constructor runs by matching the argument list at the ",[782,1864,1605],{}," call — the same overload resolution used for methods.",[1133,1867,1868,1870,1871,1874,1875,1877],{},[782,1869,1007],{}," can be passed as an argument, like any other object reference — ",[782,1872,1873],{},"logStatus(this)"," hands the current object to a method that takes one. Static methods have no ",[782,1876,1007],{}," of their own.",[1197,1879,1199],{},{"title":792,"searchDepth":805,"depth":805,"links":1881},[1882,1883,1884,1885,1886,1888,1889,1891,1893],{"id":1226,"depth":805,"text":1227},{"id":1242,"depth":805,"text":1243},{"id":1295,"depth":805,"text":1296},{"id":1376,"depth":805,"text":1377},{"id":1465,"depth":805,"text":1887},"Step 4: Put It Together in main",{"id":1638,"depth":805,"text":1639},{"id":1661,"depth":805,"text":1890},"Step 5: Pass this to Another Method",{"id":1780,"depth":805,"text":1892},"What Forgetting this Would Look Like",{"id":1846,"depth":805,"text":1847},{"outlineRef":1213,"pairsWith":1895,"status":1896},"[`lessons\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this.md`](..\u002F..\u002Flessons\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt)",{"title":563,"description":792},"CQFx7yoQBrJFKEPcOUq8vyYXSzmiByAnCYPdtewmvHI",{"id":1900,"title":724,"body":1901,"description":792,"extension":1211,"meta":2291,"navigation":820,"path":723,"seo":2293,"stem":725,"__hash__":2294},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this.md",{"type":761,"value":1902,"toc":2287},[1903,1906,1910,1920,1943,1954,1959,1982,1988,2008,2028,2032,2045,2048,2117,2122,2188,2285],[764,1904,724],{"id":1905},"constructors-this-exercises",[768,1907,1909],{"id":1908},"multiple-choice","Multiple Choice",[773,1911,1912,1915,1916,1919],{},[777,1913,1914],{},"Question:"," A teammate writes this constructor for an ",[782,1917,1918],{},"Intake"," class:",[787,1921,1923],{"className":789,"code":1922,"language":791,"meta":792,"style":792},"public Intake(int rollerPort)\n{\n    rollerPort = rollerPort;\n}\n",[782,1924,1925,1930,1934,1939],{"__ignoreMap":792},[796,1926,1927],{"class":798,"line":799},[796,1928,1929],{},"public Intake(int rollerPort)\n",[796,1931,1932],{"class":798,"line":805},[796,1933,808],{},[796,1935,1936],{"class":798,"line":811},[796,1937,1938],{},"    rollerPort = rollerPort;\n",[796,1940,1941],{"class":798,"line":817},[796,1942,851],{},[773,1944,1945,1946,1949,1950,1953],{},"After ",[782,1947,1948],{},"Intake front = new Intake(3);",", what is ",[782,1951,1952],{},"front.rollerPort","?",[773,1955,1956],{},[777,1957,1958],{},"Options:",[1130,1960,1961,1967,1972,1975],{},[1133,1962,1963,1964],{},"A. ",[782,1965,1966],{},"3",[1133,1968,1969,1970],{},"B. ",[782,1971,861],{},[1133,1973,1974],{},"C. It won't compile",[1133,1976,1977,1978,1981],{},"D. It depends on where ",[782,1979,1980],{},"rollerPort"," is declared in the class",[773,1983,1984,1987],{},[777,1985,1986],{},"Answer:"," B",[773,1989,1990,1993,1994,866,1996,1999,2000,2002,2003,2005,2006,1186],{},[777,1991,1992],{},"Why:"," Without ",[782,1995,1007],{},[782,1997,1998],{},"rollerPort = rollerPort;"," assigns the parameter to itself — the closest name in scope on both sides is the parameter, not the instance variable. The instance variable ",[782,2001,1980],{}," is never touched, so it stays at its default value for an ",[782,2004,865],{},", which is ",[782,2007,861],{},[1130,2009,2010,2013,2019],{},[1133,2011,2012],{},"A is wrong — it assumes the assignment reached the instance variable, but it never does; that's exactly the bug.",[1133,2014,2015,2016,2018],{},"C is wrong — both sides of ",[782,2017,1998],{}," are valid names (the parameter), so this compiles cleanly. The bug is silent, not a compiler error.",[1133,2020,2021,2022,2024,2025,2027],{},"D is wrong — a field's default value doesn't depend on where it's declared in the class; an unset ",[782,2023,865],{}," field is always ",[782,2026,861],{}," regardless of position.",[768,2029,2031],{"id":2030},"micro-parsons","Micro-Parsons",[773,2033,2034,2037,2038,2041,2042,2044],{},[777,2035,2036],{},"Problem:"," These lines, once correctly ordered, form a complete program that builds one ",[782,2039,2040],{},"Shooter"," and prints the wheel port it was given, using ",[782,2043,1007],{}," to correctly set the field from the constructor's parameter of the same name.",[773,2046,2047],{},"Reorder the fragments below into a working program:",[1130,2049,2050,2056,2062,2068,2074,2080,2086,2092,2097,2103,2109],{},[1133,2051,2052,2053],{},"a. ",[782,2054,2055],{},"    public static void main(String[] args)",[1133,2057,2058,2059],{},"b. ",[782,2060,2061],{},"    private int wheelPort;",[1133,2063,2064,2065],{},"c. ",[782,2066,2067],{},"public class Shooter",[1133,2069,2070,2071],{},"d. ",[782,2072,2073],{},"        System.out.println(\"Wheel port: \" + new Shooter(4).wheelPort);",[1133,2075,2076,2077],{},"e. ",[782,2078,2079],{},"{",[1133,2081,2082,2083],{},"f. ",[782,2084,2085],{},"    public Shooter(int wheelPort)",[1133,2087,2088,2089],{},"g. ",[782,2090,2091],{},"    {",[1133,2093,2094,2095],{},"h. ",[782,2096,2091],{},[1133,2098,2099,2100],{},"i. ",[782,2101,2102],{},"        this.wheelPort = wheelPort;",[1133,2104,2105,2106],{},"j. ",[782,2107,2108],{},"    }",[1133,2110,2111,2112,1141,2114],{},"k. ",[782,2113,2108],{},[782,2115,2116],{},"}",[773,2118,2119,2121],{},[777,2120,1986],{}," c, e, b, f, g, i, j, a, h, d, k",[787,2123,2125],{"className":789,"code":2124,"language":791,"meta":792,"style":792},"public class Shooter\n{\n    private int wheelPort;\n\n    public Shooter(int wheelPort)\n    {\n        this.wheelPort = wheelPort;\n    }\n\n    public static void main(String[] args)\n    {\n        System.out.println(\"Wheel port: \" + new Shooter(4).wheelPort);\n    }\n}\n",[782,2126,2127,2132,2136,2141,2145,2150,2154,2159,2163,2167,2171,2175,2180,2184],{"__ignoreMap":792},[796,2128,2129],{"class":798,"line":799},[796,2130,2131],{},"public class Shooter\n",[796,2133,2134],{"class":798,"line":805},[796,2135,808],{},[796,2137,2138],{"class":798,"line":811},[796,2139,2140],{},"    private int wheelPort;\n",[796,2142,2143],{"class":798,"line":817},[796,2144,821],{"emptyLinePlaceholder":820},[796,2146,2147],{"class":798,"line":824},[796,2148,2149],{},"    public Shooter(int wheelPort)\n",[796,2151,2152],{"class":798,"line":830},[796,2153,833],{},[796,2155,2156],{"class":798,"line":836},[796,2157,2158],{},"        this.wheelPort = wheelPort;\n",[796,2160,2161],{"class":798,"line":842},[796,2162,845],{},[796,2164,2165],{"class":798,"line":848},[796,2166,821],{"emptyLinePlaceholder":820},[796,2168,2169],{"class":798,"line":962},[796,2170,1548],{},[796,2172,2173],{"class":798,"line":967},[796,2174,833],{},[796,2176,2177],{"class":798,"line":972},[796,2178,2179],{},"        System.out.println(\"Wheel port: \" + new Shooter(4).wheelPort);\n",[796,2181,2182],{"class":798,"line":978},[796,2183,845],{},[796,2185,2186],{"class":798,"line":983},[796,2187,851],{},[773,2189,2190,2193,2194,2197,2198,2201,2202,2205,2206,2209,2210,2213,2214,2217,2218,2221,2222,2225,2226,2229,2230,2232,2233,2235,2236,2239,2240,2243,2244,1282,2246,2248,2249,2251,2252,2254,2255,2258,2259,2261,2262,2264,2265,2267,2268,2235,2271,2274,2275,2277,2278,2280,2281,2284],{},[777,2191,2192],{},"Why this order:"," The class line (",[782,2195,2196],{},"c",") comes first with its opening brace (",[782,2199,2200],{},"e",") right after. The field (",[782,2203,2204],{},"b",") is declared before any constructor uses it. The constructor's signature (",[782,2207,2208],{},"f",") and its opening brace (",[782,2211,2212],{},"g",") stay as separate one-line fragments, and its single statement (",[782,2215,2216],{},"i",") and closing brace (",[782,2219,2220],{},"j",") stay separate too — ",[782,2223,2224],{},"this.wheelPort = wheelPort;"," is the only line that can actually reach the instance variable, since the parameter ",[782,2227,2228],{},"wheelPort"," shadows the field and the left-hand side needs ",[782,2231,1007],{}," to mean something different from the right-hand side; that's the exact placement this lesson is testing, so it's kept fully granular rather than fused away. ",[782,2234,1469],{}," (",[782,2237,2238],{},"a",") is declared next, with its own opening brace (",[782,2241,2242],{},"h",") kept as a separate fragment — ",[782,2245,2212],{},[782,2247,2242],{}," are textually identical (",[782,2250,2091],{},"), so only the surrounding context tells them apart. Note that ",[782,2253,2220],{}," (the constructor's closing brace) is ",[1155,2256,2257],{},"not"," fused with ",[782,2260,2238],{}," (main's signature): Java doesn't require ",[782,2263,1469],{}," to come after the constructor, so that adjacency is a genuine ordering choice, not a forced one. Inside ",[782,2266,1469],{},", the ",[782,2269,2270],{},"println",[782,2272,2273],{},"d",") builds a new ",[782,2276,2040],{}," and reads its field back. Only at the very end is there a truly forced pair: once ",[782,2279,1469],{},"'s closing brace is placed, the class's closing brace is the only fragment left with nowhere else it could go, so those two are fused into one fragment (",[782,2282,2283],{},"k",").",[1197,2286,1199],{},{"title":792,"searchDepth":805,"depth":805,"links":2288},[2289,2290],{"id":1908,"depth":805,"text":1909},{"id":2030,"depth":805,"text":2031},{"outlineRef":1213,"pairsWith":1895,"status":2292},"new — authored exercises (Multiple Choice + Micro-Parsons)",{"title":724,"description":792},"pqmVK5BGzCv36FJE4X4btCp9KnuEqmUblpBZGy2PVfU",1790274944371]