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