[{"data":1,"prerenderedAt":4004},["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":1070,"item-example-full-ch19-interfaces-as-contracts-19":1890,"item-exercise-full-ch19-interfaces-as-contracts-19":2619},[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":242,"body":1072,"description":1112,"extension":1884,"meta":1885,"navigation":1186,"path":241,"seo":1888,"stem":243,"__hash__":1889},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts.md",{"type":1073,"value":1074,"toc":1871},"minimark",[1075,1079,1084,1106,1148,1158,1204,1237,1241,1251,1274,1277,1281,1284,1312,1318,1322,1329,1364,1374,1378,1387,1433,1440,1444,1463,1519,1537,1544,1579,1596,1601,1608,1612,1639,1716,1720,1789,1793,1836,1867],[1076,1077,242],"h1",{"id":1078},"interfaces-as-contracts",[1080,1081,1083],"h2",{"id":1082},"what-vs-how","What vs. How",[1085,1086,1087,1088,1092,1093,1097,1098,1101,1102,1105],"p",{},"An ",[1089,1090,1091],"strong",{},"interface"," defines ",[1094,1095,1096],"em",{},"what"," an object can do, without specifying ",[1094,1099,1100],{},"how"," it does it. It's a \"contract\" — a set of method signatures any implementing class agrees to provide, with no implementation of its own for those methods (every one of those methods is ",[1089,1103,1104],{},"abstract",", Lesson 17.5's term for a signature with no body). This matters enormously in real engineering: it lets two groups write code against a shared agreement without either needing to know the other's internals — a hardware vendor and an application team can each build against the same interface independently, as long as both honor it.",[1107,1108,1113],"pre",{"className":1109,"code":1110,"language":1111,"meta":1112,"style":1112},"language-java shiki shiki-themes github-light github-dark","public interface IntakeIO\n{\n    void updateInputs(IntakeInputs inputs);\n    void setVoltage(double volts);\n}\n","java","",[1114,1115,1116,1124,1130,1136,1142],"code",{"__ignoreMap":1112},[1117,1118,1121],"span",{"class":1119,"line":1120},"line",1,[1117,1122,1123],{},"public interface IntakeIO\n",[1117,1125,1127],{"class":1119,"line":1126},2,[1117,1128,1129],{},"{\n",[1117,1131,1133],{"class":1119,"line":1132},3,[1117,1134,1135],{},"    void updateInputs(IntakeInputs inputs);\n",[1117,1137,1139],{"class":1119,"line":1138},4,[1117,1140,1141],{},"    void setVoltage(double volts);\n",[1117,1143,1145],{"class":1119,"line":1144},5,[1117,1146,1147],{},"}\n",[1085,1149,1150,1151,1153,1154,1157],{},"Method signatures inside an interface have no body — just a semicolon, no braces. ",[1114,1152,1091],{}," is the keyword; a class agrees to the contract with ",[1114,1155,1156],{},"implements",":",[1107,1159,1161],{"className":1109,"code":1160,"language":1111,"meta":1112,"style":1112},"public class RealIntakeIO implements IntakeIO\n{\n    @Override\n    public void updateInputs(IntakeInputs inputs) { \u002F* real sensor reads *\u002F }\n\n    @Override\n    public void setVoltage(double volts) { \u002F* real motor.setVoltage(volts) *\u002F }\n}\n",[1114,1162,1163,1168,1172,1177,1182,1188,1193,1199],{"__ignoreMap":1112},[1117,1164,1165],{"class":1119,"line":1120},[1117,1166,1167],{},"public class RealIntakeIO implements IntakeIO\n",[1117,1169,1170],{"class":1119,"line":1126},[1117,1171,1129],{},[1117,1173,1174],{"class":1119,"line":1132},[1117,1175,1176],{},"    @Override\n",[1117,1178,1179],{"class":1119,"line":1138},[1117,1180,1181],{},"    public void updateInputs(IntakeInputs inputs) { \u002F* real sensor reads *\u002F }\n",[1117,1183,1184],{"class":1119,"line":1144},[1117,1185,1187],{"emptyLinePlaceholder":1186},true,"\n",[1117,1189,1191],{"class":1119,"line":1190},6,[1117,1192,1176],{},[1117,1194,1196],{"class":1119,"line":1195},7,[1117,1197,1198],{},"    public void setVoltage(double volts) { \u002F* real motor.setVoltage(volts) *\u002F }\n",[1117,1200,1202],{"class":1119,"line":1201},8,[1117,1203,1147],{},[1085,1205,1206,1207,1210,1211,1214,1215,1218,1219,1221,1222,1225,1226,1229,1230,1233,1234,1236],{},"A class implementing an interface must provide a real method body for ",[1094,1208,1209],{},"every"," method the interface declares (default and static methods excepted — see below) — or the class fails to compile. Every one of those methods is implicitly ",[1114,1212,1213],{},"public",", even though ",[1114,1216,1217],{},"IntakeIO"," never writes the word — an implementing method has to be written ",[1114,1220,1213],{}," too, or it doesn't compile: a ",[1114,1223,1224],{},"private"," or package-private ",[1114,1227,1228],{},"updateInputs"," would be ",[1094,1231,1232],{},"weakening"," access the interface already promised as ",[1114,1235,1213],{},".",[1080,1238,1240],{"id":1239},"multiple-interfaces-one-superclass","Multiple Interfaces, One Superclass",[1085,1242,1243,1244,1247,1248,1250],{},"Unlike ",[1114,1245,1246],{},"extends"," (limited to exactly one superclass — Lesson 17.1), a class can ",[1114,1249,1156],{}," as many interfaces as it needs:",[1107,1252,1254],{"className":1109,"code":1253,"language":1111,"meta":1112,"style":1112},"public class Intake implements Stowable, Diagnosable\n{\n    \u002F\u002F must provide every method declared by BOTH Stowable and Diagnosable\n}\n",[1114,1255,1256,1261,1265,1270],{"__ignoreMap":1112},[1117,1257,1258],{"class":1119,"line":1120},[1117,1259,1260],{},"public class Intake implements Stowable, Diagnosable\n",[1117,1262,1263],{"class":1119,"line":1126},[1117,1264,1129],{},[1117,1266,1267],{"class":1119,"line":1132},[1117,1268,1269],{},"    \u002F\u002F must provide every method declared by BOTH Stowable and Diagnosable\n",[1117,1271,1272],{"class":1119,"line":1138},[1117,1273,1147],{},[1085,1275,1276],{},"This is one of the biggest practical differences between inheritance and interfaces: a class has one parent, but can honor any number of separate contracts at once.",[1080,1278,1280],{"id":1279},"using-an-interface-as-a-type","Using an Interface as a Type",[1085,1282,1283],{},"Just like a superclass (Lesson 17.3), an interface is a real reference type — a variable, parameter, array, or collection can be declared against an interface type, and hold any object whose class implements it:",[1107,1285,1287],{"className":1109,"code":1286,"language":1111,"meta":1112,"style":1112},"public void configureIntake(IntakeIO io)\n{\n    \u002F\u002F works for RealIntakeIO, SimIntakeIO, or any other IntakeIO implementation\n    io.setVoltage(0.0);\n}\n",[1114,1288,1289,1294,1298,1303,1308],{"__ignoreMap":1112},[1117,1290,1291],{"class":1119,"line":1120},[1117,1292,1293],{},"public void configureIntake(IntakeIO io)\n",[1117,1295,1296],{"class":1119,"line":1126},[1117,1297,1129],{},[1117,1299,1300],{"class":1119,"line":1132},[1117,1301,1302],{},"    \u002F\u002F works for RealIntakeIO, SimIntakeIO, or any other IntakeIO implementation\n",[1117,1304,1305],{"class":1119,"line":1138},[1117,1306,1307],{},"    io.setVoltage(0.0);\n",[1117,1309,1310],{"class":1119,"line":1144},[1117,1311,1147],{},[1085,1313,1314,1315,1317],{},"Code written against ",[1114,1316,1217],{}," never needs to know or care which concrete implementation it's actually working with — real hardware, or a simulated stand-in (this exact pattern is the foundation of the IO-Layer Pattern, Ch.20).",[1080,1319,1321],{"id":1320},"interface-constants","Interface Constants",[1085,1323,1324,1325,1328],{},"A field declared inside an interface is implicitly ",[1114,1326,1327],{},"public static final"," — a shared constant, not per-object state (an interface has no object state of its own; it declares behavior, not fields to hold data):",[1107,1330,1332],{"className":1109,"code":1331,"language":1111,"meta":1112,"style":1112},"public interface IntakeIO\n{\n    \u002F\u002F implicitly public static final — same as Lesson 7.4's constants\n    double MAX_VOLTS = 12.0;\n\n    void setVoltage(double volts);\n}\n",[1114,1333,1334,1338,1342,1347,1352,1356,1360],{"__ignoreMap":1112},[1117,1335,1336],{"class":1119,"line":1120},[1117,1337,1123],{},[1117,1339,1340],{"class":1119,"line":1126},[1117,1341,1129],{},[1117,1343,1344],{"class":1119,"line":1132},[1117,1345,1346],{},"    \u002F\u002F implicitly public static final — same as Lesson 7.4's constants\n",[1117,1348,1349],{"class":1119,"line":1138},[1117,1350,1351],{},"    double MAX_VOLTS = 12.0;\n",[1117,1353,1354],{"class":1119,"line":1144},[1117,1355,1187],{"emptyLinePlaceholder":1186},[1117,1357,1358],{"class":1119,"line":1190},[1117,1359,1141],{},[1117,1361,1362],{"class":1119,"line":1195},[1117,1363,1147],{},[1085,1365,1366,1369,1370,1373],{},[1114,1367,1368],{},"IntakeIO.MAX_VOLTS"," reads it directly off the interface name, exactly like any other ",[1114,1371,1372],{},"static final"," constant (Lesson 7.4).",[1080,1375,1377],{"id":1376},"one-interface-extending-another","One Interface Extending Another",[1085,1379,1380,1381,1383,1384,1386],{},"An interface can ",[1114,1382,1246],{}," another interface — not a class — to build a bigger contract out of a smaller one. Unlike a class, an interface can ",[1114,1385,1246],{}," more than one interface at once, since there's no object state to conflict:",[1107,1388,1390],{"className":1109,"code":1389,"language":1111,"meta":1112,"style":1112},"public interface Diagnosable\n{\n    String getStatus();\n}\n\npublic interface LoggingDiagnosable extends Diagnosable\n{\n    void logStatus(); \u002F\u002F LoggingDiagnosable now requires BOTH getStatus() and logStatus()\n}\n",[1114,1391,1392,1397,1401,1406,1410,1414,1419,1423,1428],{"__ignoreMap":1112},[1117,1393,1394],{"class":1119,"line":1120},[1117,1395,1396],{},"public interface Diagnosable\n",[1117,1398,1399],{"class":1119,"line":1126},[1117,1400,1129],{},[1117,1402,1403],{"class":1119,"line":1132},[1117,1404,1405],{},"    String getStatus();\n",[1117,1407,1408],{"class":1119,"line":1138},[1117,1409,1147],{},[1117,1411,1412],{"class":1119,"line":1144},[1117,1413,1187],{"emptyLinePlaceholder":1186},[1117,1415,1416],{"class":1119,"line":1190},[1117,1417,1418],{},"public interface LoggingDiagnosable extends Diagnosable\n",[1117,1420,1421],{"class":1119,"line":1195},[1117,1422,1129],{},[1117,1424,1425],{"class":1119,"line":1201},[1117,1426,1427],{},"    void logStatus(); \u002F\u002F LoggingDiagnosable now requires BOTH getStatus() and logStatus()\n",[1117,1429,1431],{"class":1119,"line":1430},9,[1117,1432,1147],{},[1085,1434,1435,1436,1439],{},"A class that ",[1114,1437,1438],{},"implements LoggingDiagnosable"," must provide both methods — the inherited one and the new one.",[1080,1441,1443],{"id":1442},"default-and-static-methods","Default and Static Methods",[1085,1445,1446,1447,1450,1451,1454,1455,1458,1459,1462],{},"Normally every method in an interface is abstract (no body). ",[1089,1448,1449],{},"Default"," and ",[1089,1452,1453],{},"static"," methods are the exceptions. A ",[1089,1456,1457],{},"default method"," provides a real implementation directly inside the interface, marked with the ",[1114,1460,1461],{},"default"," keyword, which implementing classes inherit automatically without being forced to write it themselves. The strongest default methods build on top of the interface's own abstract methods, adding real behavior without weakening the contract:",[1107,1464,1466],{"className":1109,"code":1465,"language":1111,"meta":1112,"style":1112},"public interface IntakeIO\n{\n    void updateInputs(IntakeInputs inputs);\n    void setVoltage(double volts);\n\n    default void stop()\n    {\n        \u002F\u002F built on top of the abstract method every implementer must provide\n        setVoltage(0.0);\n    }\n}\n",[1114,1467,1468,1472,1476,1480,1484,1488,1493,1498,1503,1508,1514],{"__ignoreMap":1112},[1117,1469,1470],{"class":1119,"line":1120},[1117,1471,1123],{},[1117,1473,1474],{"class":1119,"line":1126},[1117,1475,1129],{},[1117,1477,1478],{"class":1119,"line":1132},[1117,1479,1135],{},[1117,1481,1482],{"class":1119,"line":1138},[1117,1483,1141],{},[1117,1485,1486],{"class":1119,"line":1144},[1117,1487,1187],{"emptyLinePlaceholder":1186},[1117,1489,1490],{"class":1119,"line":1190},[1117,1491,1492],{},"    default void stop()\n",[1117,1494,1495],{"class":1119,"line":1195},[1117,1496,1497],{},"    {\n",[1117,1499,1500],{"class":1119,"line":1201},[1117,1501,1502],{},"        \u002F\u002F built on top of the abstract method every implementer must provide\n",[1117,1504,1505],{"class":1119,"line":1430},[1117,1506,1507],{},"        setVoltage(0.0);\n",[1117,1509,1511],{"class":1119,"line":1510},10,[1117,1512,1513],{},"    }\n",[1117,1515,1517],{"class":1119,"line":1516},11,[1117,1518,1147],{},[1085,1520,1521,1450,1523,1526,1527,1530,1531,1533,1534,1536],{},[1114,1522,1228],{},[1114,1524,1525],{},"setVoltage"," are still required — every implementing class must provide them, or it won't compile. ",[1114,1528,1529],{},"stop()"," comes for free: it's written once, here, and every ",[1114,1532,1217],{}," implementation inherits it automatically, calling that implementation's own ",[1114,1535,1525],{},". This matters for a very practical reason: default methods let an interface add new methods later without breaking every class that already implements it — existing implementations simply inherit the default behavior rather than suddenly failing to compile. A class can still override a default method with its own real implementation, exactly like overriding an inherited method from a superclass (Lesson 18.1).",[1085,1538,1539,1540,1543],{},"An interface can also declare ",[1089,1541,1542],{},"static methods"," — utility methods associated with the interface itself, not with any implementing object, called directly on the interface name rather than through an instance:",[1107,1545,1547],{"className":1109,"code":1546,"language":1111,"meta":1112,"style":1112},"public interface IntakeIO\n{\n    static double clampVolts(double v)\n    {\n        return Math.max(-12.0, Math.min(12.0, v));\n    }\n}\n",[1114,1548,1549,1553,1557,1562,1566,1571,1575],{"__ignoreMap":1112},[1117,1550,1551],{"class":1119,"line":1120},[1117,1552,1123],{},[1117,1554,1555],{"class":1119,"line":1126},[1117,1556,1129],{},[1117,1558,1559],{"class":1119,"line":1132},[1117,1560,1561],{},"    static double clampVolts(double v)\n",[1117,1563,1564],{"class":1119,"line":1138},[1117,1565,1497],{},[1117,1567,1568],{"class":1119,"line":1144},[1117,1569,1570],{},"        return Math.max(-12.0, Math.min(12.0, v));\n",[1117,1572,1573],{"class":1119,"line":1190},[1117,1574,1513],{},[1117,1576,1577],{"class":1119,"line":1195},[1117,1578,1147],{},[1085,1580,1581,1584,1585,1587,1588,1591,1592,1595],{},[1114,1582,1583],{},"IntakeIO.clampVolts(14.0)"," calls it directly on the interface name — no ",[1114,1586,1217],{}," object needed, the same way ",[1114,1589,1590],{},"Math.max(...)"," needs no ",[1114,1593,1594],{},"Math"," object.",[1597,1598,1600],"h3",{"id":1599},"when-two-interfaces-defaults-collide","When Two Interfaces' Defaults Collide",[1085,1602,1603,1604,1607],{},"If a class implements two interfaces that both supply a default method with the same signature, Java can't pick one for you — the class must override that method itself (calling one of them explicitly, e.g. ",[1114,1605,1606],{},"Stowable.super.stop()",", if that's what's wanted), or it's a compile error. This only comes up with defaults; two abstract methods with the same signature just merge into one requirement.",[1080,1609,1611],{"id":1610},"interface-or-abstract-class","Interface or Abstract Class?",[1085,1613,1614,1615,1618,1619,1622,1623,1450,1626,1629,1630,1632,1633,1635,1636,1638],{},"Lesson 17.5 introduced abstract classes as the other tool for \"some methods without bodies, filled in by subclasses\" — and promised this comparison. The short version: reach for an ",[1089,1616,1617],{},"abstract class"," when the related classes share real state and code (fields, constructors, concrete helper methods) — like ",[1114,1620,1621],{},"RobotPart","'s ",[1114,1624,1625],{},"name",[1114,1627,1628],{},"log()",". Reach for an ",[1089,1631,1091],{}," when classes only need to share a set of methods, with no shared state, and especially when a class needs to honor more than one contract at once (a class can ",[1114,1634,1156],{}," many interfaces, but ",[1114,1637,1246],{}," only one class).",[1640,1641,1642,1657],"table",{},[1643,1644,1645],"thead",{},[1646,1647,1648,1651,1654],"tr",{},[1649,1650],"th",{},[1649,1652,1653],{},"Abstract class",[1649,1655,1656],{},"Interface",[1658,1659,1660,1675,1685,1701],"tbody",{},[1646,1661,1662,1666,1669],{},[1663,1664,1665],"td",{},"Fields (state)",[1663,1667,1668],{},"Yes",[1663,1670,1671,1672,1674],{},"Only ",[1114,1673,1327],{}," constants",[1646,1676,1677,1680,1682],{},[1663,1678,1679],{},"Constructors",[1663,1681,1668],{},[1663,1683,1684],{},"No",[1646,1686,1687,1690,1696],{},[1663,1688,1689],{},"How many can a class have?",[1663,1691,1692,1693,1695],{},"One (",[1114,1694,1246],{},")",[1663,1697,1698,1699,1695],{},"Any number (",[1114,1700,1156],{},[1646,1702,1703,1706,1709],{},[1663,1704,1705],{},"Method bodies allowed?",[1663,1707,1708],{},"Yes, freely",[1663,1710,1671,1711,1713,1714],{},[1114,1712,1461],{},"\u002F",[1114,1715,1453],{},[1080,1717,1719],{"id":1718},"common-pitfalls","Common Pitfalls",[1721,1722,1723,1730,1746,1758,1779],"ul",{},[1724,1725,1726,1729],"li",{},[1089,1727,1728],{},"Forgetting to implement every abstract method an interface declares."," A class that leaves even one required method unimplemented fails to compile — every non-default, non-static method is a firm requirement.",[1724,1731,1732,1739,1740,1742,1743,1745],{},[1089,1733,1734,1735,1450,1737,1236],{},"Confusing ",[1114,1736,1246],{},[1114,1738,1156],{}," A class ",[1114,1741,1246],{}," exactly one class, but can ",[1114,1744,1156],{}," any number of interfaces — these are two entirely separate mechanisms.",[1724,1747,1748,1751,1752,1754,1755,1757],{},[1089,1749,1750],{},"Assuming every interface method needs to be written from scratch."," Default methods (like ",[1114,1753,1529],{}," on ",[1114,1756,1217],{}," above) come \"for free\" — only override one if the default behavior isn't what you want.",[1724,1759,1760,1765,1766,1768,1769,1772,1773,1775,1776,1778],{},[1089,1761,1762,1763,1236],{},"Writing an implementing method with weaker access than ",[1114,1764,1213],{}," Every interface method is implicitly ",[1114,1767,1213],{},"; a ",[1114,1770,1771],{},"RealIntakeIO.updateInputs"," declared without ",[1114,1774,1213],{}," (or as ",[1114,1777,1224],{},") fails to compile with \"attempting to assign weaker access privileges.\"",[1724,1780,1781,1784,1785,1788],{},[1089,1782,1783],{},"Making every interface method an empty default \"for convenience.\""," That silently removes the compiler's guarantee that an implementation provides real behavior — a class that forgets to override an empty ",[1114,1786,1787],{},"default setVoltage(double)"," compiles fine and simply never moves the motor. Keep methods abstract unless a default genuinely builds useful shared behavior on top of them.",[1080,1790,1792],{"id":1791},"key-takeaways","Key Takeaways",[1721,1794,1795,1809,1821,1824,1833],{},[1724,1796,1797,1798,1800,1801,1803,1804,1806,1807,1236],{},"An interface is a contract: method signatures with no implementation (default\u002Fstatic methods aside), specifying ",[1094,1799,1096],{}," a class can do, not ",[1094,1802,1100],{}," — every abstract method is implicitly ",[1114,1805,1213],{},", and every field is implicitly ",[1114,1808,1327],{},[1724,1810,1811,1812,1814,1815,1817,1818,1820],{},"A class agrees to an interface's contract with ",[1114,1813,1156],{},", and can implement any number of interfaces at once — unlike the single-superclass limit of ",[1114,1816,1246],{},". An interface can itself ",[1114,1819,1246],{}," one or more other interfaces.",[1724,1822,1823],{},"An interface is a real type — variables, parameters, arrays, and collections can all be declared against it, holding any object whose class implements it.",[1724,1825,1826,1827,1829,1830,1832],{},"A ",[1114,1828,1461],{}," method provides a real implementation directly in the interface, letting implementing classes inherit it without writing their own; a ",[1114,1831,1453],{}," method belongs to the interface itself, called on its name. Two colliding defaults force the implementing class to override and resolve them.",[1724,1834,1835],{},"Abstract class vs. interface (Lesson 17.5): shared state and code → abstract class; shared behavior only, or multiple contracts at once → interface.",[1085,1837,1838,1839,1842,1843,1846,1847,1846,1850,1846,1853,1846,1856,1846,1859,1862,1863,1866],{},"Derived from ",[1114,1840,1841],{},"other-reference-repo",": ",[1114,1844,1845],{},"oracle-java-tutorials\u002Finterfaces\u002F01-interfaces.md",", ",[1114,1848,1849],{},"02-defining-an-interface.md",[1114,1851,1852],{},"03-implementing-an-interface.md",[1114,1854,1855],{},"04-using-an-interface-as-a-type.md",[1114,1857,1858],{},"05-default-methods.md",[1114,1860,1861],{},"06-summary-of-interfaces.md"," (ORACLE 15.1-6)\n",[1089,1864,1865],{},"Deck context:"," mechacoder-test\u002Fsrc\u002Flessons\u002Fjava-2.js, slide 6 (\"Interfaces as Contracts\") — IntakeIO example",[1868,1869,1870],"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":1126,"depth":1126,"links":1872},[1873,1874,1875,1876,1877,1878,1881,1882,1883],{"id":1082,"depth":1126,"text":1083},{"id":1239,"depth":1126,"text":1240},{"id":1279,"depth":1126,"text":1280},{"id":1320,"depth":1126,"text":1321},{"id":1376,"depth":1126,"text":1377},{"id":1442,"depth":1126,"text":1443,"children":1879},[1880],{"id":1599,"depth":1132,"text":1600},{"id":1610,"depth":1126,"text":1611},{"id":1718,"depth":1126,"text":1719},{"id":1791,"depth":1126,"text":1792},"md",{"outlineRef":1886,"status":1887},"19 — Interfaces as Contracts (ORACLE 15.1-6)","new — authored lesson (fuller depth than the teaser slide)",{"title":242,"description":1112},"gomPHyhX7zSiFiZH6enwa5B_pbXV2ngWLBtEFQPJM1o",{"id":1891,"title":675,"body":1892,"description":1112,"extension":1884,"meta":2614,"navigation":1186,"path":674,"seo":2617,"stem":676,"__hash__":2618},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts.md",{"type":1073,"value":1893,"toc":2604},[1894,1897,1901,1904,1908,1911,1934,1946,1950,1961,2121,2127,2131,2140,2163,2169,2173,2182,2225,2237,2241,2249,2527,2541,2545,2553,2571,2575,2602],[1076,1895,675],{"id":1896},"interfaces-as-contracts-worked-example",[1080,1898,1900],{"id":1899},"problem","Problem",[1085,1902,1903],{},"The robot might use either of two different distance sensors to detect the wall: a laser sensor or a sonar sensor. They work completely differently inside, but the code that uses them only needs one thing — \"tell me the distance in meters.\" Write a contract both sensors agree to, a method that works with either one, and then add a \"too close?\" check to every sensor at once without editing either sensor class.",[1080,1905,1907],{"id":1906},"step-1-write-the-contract","Step 1: Write the Contract",[1085,1909,1910],{},"The one thing every range finder must be able to do is report a distance. That's a method signature with no body:",[1107,1912,1914],{"className":1109,"code":1913,"language":1111,"meta":1112,"style":1112},"interface RangeFinder\n{\n    double getDistanceMeters();\n}\n",[1114,1915,1916,1921,1925,1930],{"__ignoreMap":1112},[1117,1917,1918],{"class":1119,"line":1120},[1117,1919,1920],{},"interface RangeFinder\n",[1117,1922,1923],{"class":1119,"line":1126},[1117,1924,1129],{},[1117,1926,1927],{"class":1119,"line":1132},[1117,1928,1929],{},"    double getDistanceMeters();\n",[1117,1931,1932],{"class":1119,"line":1138},[1117,1933,1147],{},[1085,1935,1936,1937,1939,1940,1943,1944,1236],{},"This says ",[1094,1938,1096],{}," a ",[1114,1941,1942],{},"RangeFinder"," can do, but nothing about ",[1094,1945,1100],{},[1080,1947,1949],{"id":1948},"step-2-two-classes-sign-the-contract","Step 2: Two Classes Sign the Contract",[1085,1951,1952,1953,1956,1957,1960],{},"Each sensor class ",[1114,1954,1955],{},"implements RangeFinder",", which obligates it to provide a real body for ",[1114,1958,1959],{},"getDistanceMeters()",". Since there's no real hardware here, each one just holds a reading passed in when it's built, standing in for what the sensor would measure:",[1107,1962,1964],{"className":1109,"code":1963,"language":1111,"meta":1112,"style":1112},"class LaserRangeFinder implements RangeFinder\n{\n    private double reading;\n\n    public LaserRangeFinder(double reading)\n    {\n        this.reading = reading;\n    }\n\n    @Override\n    public double getDistanceMeters()\n    {\n        return reading;\n    }\n}\n\nclass SonarRangeFinder implements RangeFinder\n{\n    private double readingInches;\n\n    public SonarRangeFinder(double readingInches)\n    {\n        this.readingInches = readingInches;\n    }\n\n    @Override\n    public double getDistanceMeters()\n    {\n        return readingInches * 0.0254; \u002F\u002F this sensor measures in inches, so convert\n    }\n}\n",[1114,1965,1966,1971,1975,1980,1984,1989,1993,1998,2002,2006,2010,2015,2020,2026,2031,2036,2041,2047,2052,2058,2063,2069,2074,2080,2085,2090,2095,2100,2105,2111,2116],{"__ignoreMap":1112},[1117,1967,1968],{"class":1119,"line":1120},[1117,1969,1970],{},"class LaserRangeFinder implements RangeFinder\n",[1117,1972,1973],{"class":1119,"line":1126},[1117,1974,1129],{},[1117,1976,1977],{"class":1119,"line":1132},[1117,1978,1979],{},"    private double reading;\n",[1117,1981,1982],{"class":1119,"line":1138},[1117,1983,1187],{"emptyLinePlaceholder":1186},[1117,1985,1986],{"class":1119,"line":1144},[1117,1987,1988],{},"    public LaserRangeFinder(double reading)\n",[1117,1990,1991],{"class":1119,"line":1190},[1117,1992,1497],{},[1117,1994,1995],{"class":1119,"line":1195},[1117,1996,1997],{},"        this.reading = reading;\n",[1117,1999,2000],{"class":1119,"line":1201},[1117,2001,1513],{},[1117,2003,2004],{"class":1119,"line":1430},[1117,2005,1187],{"emptyLinePlaceholder":1186},[1117,2007,2008],{"class":1119,"line":1510},[1117,2009,1176],{},[1117,2011,2012],{"class":1119,"line":1516},[1117,2013,2014],{},"    public double getDistanceMeters()\n",[1117,2016,2018],{"class":1119,"line":2017},12,[1117,2019,1497],{},[1117,2021,2023],{"class":1119,"line":2022},13,[1117,2024,2025],{},"        return reading;\n",[1117,2027,2029],{"class":1119,"line":2028},14,[1117,2030,1513],{},[1117,2032,2034],{"class":1119,"line":2033},15,[1117,2035,1147],{},[1117,2037,2039],{"class":1119,"line":2038},16,[1117,2040,1187],{"emptyLinePlaceholder":1186},[1117,2042,2044],{"class":1119,"line":2043},17,[1117,2045,2046],{},"class SonarRangeFinder implements RangeFinder\n",[1117,2048,2050],{"class":1119,"line":2049},18,[1117,2051,1129],{},[1117,2053,2055],{"class":1119,"line":2054},19,[1117,2056,2057],{},"    private double readingInches;\n",[1117,2059,2061],{"class":1119,"line":2060},20,[1117,2062,1187],{"emptyLinePlaceholder":1186},[1117,2064,2066],{"class":1119,"line":2065},21,[1117,2067,2068],{},"    public SonarRangeFinder(double readingInches)\n",[1117,2070,2072],{"class":1119,"line":2071},22,[1117,2073,1497],{},[1117,2075,2077],{"class":1119,"line":2076},23,[1117,2078,2079],{},"        this.readingInches = readingInches;\n",[1117,2081,2083],{"class":1119,"line":2082},24,[1117,2084,1513],{},[1117,2086,2088],{"class":1119,"line":2087},25,[1117,2089,1187],{"emptyLinePlaceholder":1186},[1117,2091,2093],{"class":1119,"line":2092},26,[1117,2094,1176],{},[1117,2096,2098],{"class":1119,"line":2097},27,[1117,2099,2014],{},[1117,2101,2103],{"class":1119,"line":2102},28,[1117,2104,1497],{},[1117,2106,2108],{"class":1119,"line":2107},29,[1117,2109,2110],{},"        return readingInches * 0.0254; \u002F\u002F this sensor measures in inches, so convert\n",[1117,2112,2114],{"class":1119,"line":2113},30,[1117,2115,1513],{},[1117,2117,2119],{"class":1119,"line":2118},31,[1117,2120,1147],{},[1085,2122,2123,2124,2126],{},"The two bodies are different — the sonar one converts from inches — but both honor the same contract. If either class left ",[1114,2125,1959],{}," out, it wouldn't compile.",[1080,2128,2130],{"id":2129},"step-3-code-against-the-interface-type","Step 3: Code Against the Interface Type",[1085,2132,2133,2135,2136,2139],{},[1114,2134,1942],{}," is a real type, so a method parameter can be declared as one. The method then works with ",[1094,2137,2138],{},"any"," class that implements it:",[1107,2141,2143],{"className":1109,"code":2142,"language":1111,"meta":1112,"style":1112},"public static void checkWall(RangeFinder sensor)\n{\n    System.out.println(\"Wall is \" + sensor.getDistanceMeters() + \" m away\");\n}\n",[1114,2144,2145,2150,2154,2159],{"__ignoreMap":1112},[1117,2146,2147],{"class":1119,"line":1120},[1117,2148,2149],{},"public static void checkWall(RangeFinder sensor)\n",[1117,2151,2152],{"class":1119,"line":1126},[1117,2153,1129],{},[1117,2155,2156],{"class":1119,"line":1132},[1117,2157,2158],{},"    System.out.println(\"Wall is \" + sensor.getDistanceMeters() + \" m away\");\n",[1117,2160,2161],{"class":1119,"line":1138},[1117,2162,1147],{},[1085,2164,2165,2168],{},[1114,2166,2167],{},"checkWall"," never needs to know whether it was handed a laser or a sonar sensor.",[1080,2170,2172],{"id":2171},"step-4-add-a-default-method-to-every-sensor-at-once","Step 4: Add a Default Method to Every Sensor at Once",[1085,2174,2175,2176,2178,2179,2181],{},"Now the team wants a \"too close?\" check. Adding a plain method signature to ",[1114,2177,1942],{}," would break both classes — each would suddenly be missing a required method. A ",[1114,2180,1461],{}," method provides the body right in the interface instead, so both classes inherit it with no edits:",[1107,2183,2185],{"className":1109,"code":2184,"language":1111,"meta":1112,"style":1112},"interface RangeFinder\n{\n    double getDistanceMeters();\n\n    default boolean isTooClose()\n    {\n        return getDistanceMeters() \u003C 0.5;\n    }\n}\n",[1114,2186,2187,2191,2195,2199,2203,2208,2212,2217,2221],{"__ignoreMap":1112},[1117,2188,2189],{"class":1119,"line":1120},[1117,2190,1920],{},[1117,2192,2193],{"class":1119,"line":1126},[1117,2194,1129],{},[1117,2196,2197],{"class":1119,"line":1132},[1117,2198,1929],{},[1117,2200,2201],{"class":1119,"line":1138},[1117,2202,1187],{"emptyLinePlaceholder":1186},[1117,2204,2205],{"class":1119,"line":1144},[1117,2206,2207],{},"    default boolean isTooClose()\n",[1117,2209,2210],{"class":1119,"line":1190},[1117,2211,1497],{},[1117,2213,2214],{"class":1119,"line":1195},[1117,2215,2216],{},"        return getDistanceMeters() \u003C 0.5;\n",[1117,2218,2219],{"class":1119,"line":1201},[1117,2220,1513],{},[1117,2222,2223],{"class":1119,"line":1430},[1117,2224,1147],{},[1085,2226,2227,2230,2231,2233,2234,2236],{},[1114,2228,2229],{},"isTooClose()"," calls ",[1114,2232,1959],{},", which every implementing class is guaranteed to have — so the default works for any ",[1114,2235,1942],{},", using that class's own distance.",[1080,2238,2240],{"id":2239},"step-5-put-it-together","Step 5: Put It Together",[1085,2242,2243,2245,2246,2248],{},[1114,2244,2167],{}," gets one more line here, printing the new ",[1114,2247,2229],{}," check alongside the distance:",[1107,2250,2252],{"className":1109,"code":2251,"language":1111,"meta":1112,"style":1112},"public class WallCheck\n{\n    public static void checkWall(RangeFinder sensor)\n    {\n        System.out.println(\"Wall is \" + sensor.getDistanceMeters() + \" m away\");\n        System.out.println(\"Too close? \" + sensor.isTooClose());\n    }\n\n    public static void main(String[] args)\n    {\n        RangeFinder laser = new LaserRangeFinder(1.25);\n        RangeFinder sonar = new SonarRangeFinder(10.0);\n\n        checkWall(laser);\n        checkWall(sonar);\n    }\n}\n\ninterface RangeFinder\n{\n    double getDistanceMeters();\n\n    default boolean isTooClose()\n    {\n        return getDistanceMeters() \u003C 0.5;\n    }\n}\n\nclass LaserRangeFinder implements RangeFinder\n{\n    private double reading;\n\n    public LaserRangeFinder(double reading)\n    {\n        this.reading = reading;\n    }\n\n    @Override\n    public double getDistanceMeters()\n    {\n        return reading;\n    }\n}\n\nclass SonarRangeFinder implements RangeFinder\n{\n    private double readingInches;\n\n    public SonarRangeFinder(double readingInches)\n    {\n        this.readingInches = readingInches;\n    }\n\n    @Override\n    public double getDistanceMeters()\n    {\n        return readingInches * 0.0254; \u002F\u002F this sensor measures in inches, so convert\n    }\n}\n",[1114,2253,2254,2259,2263,2268,2272,2277,2282,2286,2290,2295,2299,2304,2309,2313,2318,2323,2327,2331,2335,2339,2343,2347,2351,2355,2359,2363,2367,2371,2375,2379,2383,2387,2392,2397,2402,2407,2412,2417,2422,2427,2432,2437,2442,2447,2452,2457,2462,2467,2472,2477,2482,2487,2492,2497,2502,2507,2512,2517,2522],{"__ignoreMap":1112},[1117,2255,2256],{"class":1119,"line":1120},[1117,2257,2258],{},"public class WallCheck\n",[1117,2260,2261],{"class":1119,"line":1126},[1117,2262,1129],{},[1117,2264,2265],{"class":1119,"line":1132},[1117,2266,2267],{},"    public static void checkWall(RangeFinder sensor)\n",[1117,2269,2270],{"class":1119,"line":1138},[1117,2271,1497],{},[1117,2273,2274],{"class":1119,"line":1144},[1117,2275,2276],{},"        System.out.println(\"Wall is \" + sensor.getDistanceMeters() + \" m away\");\n",[1117,2278,2279],{"class":1119,"line":1190},[1117,2280,2281],{},"        System.out.println(\"Too close? \" + sensor.isTooClose());\n",[1117,2283,2284],{"class":1119,"line":1195},[1117,2285,1513],{},[1117,2287,2288],{"class":1119,"line":1201},[1117,2289,1187],{"emptyLinePlaceholder":1186},[1117,2291,2292],{"class":1119,"line":1430},[1117,2293,2294],{},"    public static void main(String[] args)\n",[1117,2296,2297],{"class":1119,"line":1510},[1117,2298,1497],{},[1117,2300,2301],{"class":1119,"line":1516},[1117,2302,2303],{},"        RangeFinder laser = new LaserRangeFinder(1.25);\n",[1117,2305,2306],{"class":1119,"line":2017},[1117,2307,2308],{},"        RangeFinder sonar = new SonarRangeFinder(10.0);\n",[1117,2310,2311],{"class":1119,"line":2022},[1117,2312,1187],{"emptyLinePlaceholder":1186},[1117,2314,2315],{"class":1119,"line":2028},[1117,2316,2317],{},"        checkWall(laser);\n",[1117,2319,2320],{"class":1119,"line":2033},[1117,2321,2322],{},"        checkWall(sonar);\n",[1117,2324,2325],{"class":1119,"line":2038},[1117,2326,1513],{},[1117,2328,2329],{"class":1119,"line":2043},[1117,2330,1147],{},[1117,2332,2333],{"class":1119,"line":2049},[1117,2334,1187],{"emptyLinePlaceholder":1186},[1117,2336,2337],{"class":1119,"line":2054},[1117,2338,1920],{},[1117,2340,2341],{"class":1119,"line":2060},[1117,2342,1129],{},[1117,2344,2345],{"class":1119,"line":2065},[1117,2346,1929],{},[1117,2348,2349],{"class":1119,"line":2071},[1117,2350,1187],{"emptyLinePlaceholder":1186},[1117,2352,2353],{"class":1119,"line":2076},[1117,2354,2207],{},[1117,2356,2357],{"class":1119,"line":2082},[1117,2358,1497],{},[1117,2360,2361],{"class":1119,"line":2087},[1117,2362,2216],{},[1117,2364,2365],{"class":1119,"line":2092},[1117,2366,1513],{},[1117,2368,2369],{"class":1119,"line":2097},[1117,2370,1147],{},[1117,2372,2373],{"class":1119,"line":2102},[1117,2374,1187],{"emptyLinePlaceholder":1186},[1117,2376,2377],{"class":1119,"line":2107},[1117,2378,1970],{},[1117,2380,2381],{"class":1119,"line":2113},[1117,2382,1129],{},[1117,2384,2385],{"class":1119,"line":2118},[1117,2386,1979],{},[1117,2388,2390],{"class":1119,"line":2389},32,[1117,2391,1187],{"emptyLinePlaceholder":1186},[1117,2393,2395],{"class":1119,"line":2394},33,[1117,2396,1988],{},[1117,2398,2400],{"class":1119,"line":2399},34,[1117,2401,1497],{},[1117,2403,2405],{"class":1119,"line":2404},35,[1117,2406,1997],{},[1117,2408,2410],{"class":1119,"line":2409},36,[1117,2411,1513],{},[1117,2413,2415],{"class":1119,"line":2414},37,[1117,2416,1187],{"emptyLinePlaceholder":1186},[1117,2418,2420],{"class":1119,"line":2419},38,[1117,2421,1176],{},[1117,2423,2425],{"class":1119,"line":2424},39,[1117,2426,2014],{},[1117,2428,2430],{"class":1119,"line":2429},40,[1117,2431,1497],{},[1117,2433,2435],{"class":1119,"line":2434},41,[1117,2436,2025],{},[1117,2438,2440],{"class":1119,"line":2439},42,[1117,2441,1513],{},[1117,2443,2445],{"class":1119,"line":2444},43,[1117,2446,1147],{},[1117,2448,2450],{"class":1119,"line":2449},44,[1117,2451,1187],{"emptyLinePlaceholder":1186},[1117,2453,2455],{"class":1119,"line":2454},45,[1117,2456,2046],{},[1117,2458,2460],{"class":1119,"line":2459},46,[1117,2461,1129],{},[1117,2463,2465],{"class":1119,"line":2464},47,[1117,2466,2057],{},[1117,2468,2470],{"class":1119,"line":2469},48,[1117,2471,1187],{"emptyLinePlaceholder":1186},[1117,2473,2475],{"class":1119,"line":2474},49,[1117,2476,2068],{},[1117,2478,2480],{"class":1119,"line":2479},50,[1117,2481,1497],{},[1117,2483,2485],{"class":1119,"line":2484},51,[1117,2486,2079],{},[1117,2488,2490],{"class":1119,"line":2489},52,[1117,2491,1513],{},[1117,2493,2495],{"class":1119,"line":2494},53,[1117,2496,1187],{"emptyLinePlaceholder":1186},[1117,2498,2500],{"class":1119,"line":2499},54,[1117,2501,1176],{},[1117,2503,2505],{"class":1119,"line":2504},55,[1117,2506,2014],{},[1117,2508,2510],{"class":1119,"line":2509},56,[1117,2511,1497],{},[1117,2513,2515],{"class":1119,"line":2514},57,[1117,2516,2110],{},[1117,2518,2520],{"class":1119,"line":2519},58,[1117,2521,1513],{},[1117,2523,2525],{"class":1119,"line":2524},59,[1117,2526,1147],{},[1085,2528,2529,2530,1846,2533,2536,2537,2540],{},"(The public class with ",[1114,2531,2532],{},"main",[1114,2534,2535],{},"WallCheck",", comes first in the file — on Java 17, ",[1114,2538,2539],{},"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,2542,2544],{"id":2543},"what-it-prints","What It Prints",[1107,2546,2551],{"className":2547,"code":2549,"language":2550},[2548],"language-text","Wall is 1.25 m away\nToo close? false\nWall is 0.254 m away\nToo close? true\n","text",[1114,2552,2549],{"__ignoreMap":1112},[1085,2554,2555,2556,2558,2559,2561,2562,2564,2565,2567,2568,2570],{},"Both variables are declared as ",[1114,2557,1942],{},", and ",[1114,2560,2167],{}," only ever sees a ",[1114,2563,1942],{}," — but each call runs that object's own ",[1114,2566,1959],{},". Neither sensor class mentions ",[1114,2569,2229],{},", yet both have it, inherited from the interface's default.",[1080,2572,2574],{"id":2573},"recap","Recap",[1721,2576,2577,2585,2591,2597],{},[1724,2578,2579,2580,2582,2583,1236],{},"An interface is a contract: method signatures with no body, saying ",[1094,2581,1096],{}," an implementing class can do, not ",[1094,2584,1100],{},[1724,2586,2587,2588,2590],{},"A class agrees to the contract with ",[1114,2589,1156],{},", and must provide a body for every abstract method the interface declares — or it won't compile.",[1724,2592,2593,2594,2596],{},"An interface is a real type: a parameter declared as ",[1114,2595,1942],{}," accepts any class that implements it.",[1724,2598,1826,2599,2601],{},[1114,2600,1461],{}," method has a body inside the interface; every implementing class inherits it automatically, which is how an interface can grow a new method without breaking existing classes.",[1868,2603,1870],{},{"title":1112,"searchDepth":1126,"depth":1126,"links":2605},[2606,2607,2608,2609,2610,2611,2612,2613],{"id":1899,"depth":1126,"text":1900},{"id":1906,"depth":1126,"text":1907},{"id":1948,"depth":1126,"text":1949},{"id":2129,"depth":1126,"text":2130},{"id":2171,"depth":1126,"text":2172},{"id":2239,"depth":1126,"text":2240},{"id":2543,"depth":1126,"text":2544},{"id":2573,"depth":1126,"text":2574},{"outlineRef":1886,"pairsWith":2615,"status":2616},"[`lessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts.md`](..\u002F..\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt)",{"title":675,"description":1112},"2vFUsqzNGK3SEzuMGyIg9MqlOyYTRQz8bGcaFToBSI8",{"id":2620,"title":988,"body":2621,"description":1112,"extension":1884,"meta":4000,"navigation":1186,"path":987,"seo":4002,"stem":989,"__hash__":4003},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts.md",{"type":1073,"value":2622,"toc":3995},[2623,2626,2630,2636,2777,2787,2792,2834,2840,2873,2903,2907,2937,3008,3019,3022,3072,3077,3173,3248,3252,3258,3273,3278,3345,3378,3383,3388,3521,3526,3531,3537,3542,3548,3553,3557,3563,3567,3573,3578,3582,3588,3592,3598,3603,3607,3613,3617,3623,3628,3632,3638,3642,3648,3653,3657,3663,3667,3673,3678,3951,3993],[1076,2624,988],{"id":2625},"interfaces-as-contracts-exercises",[1080,2627,2629],{"id":2628},"multiple-choice","Multiple Choice",[1085,2631,2632,2635],{},[1089,2633,2634],{},"Question:"," Given these two interfaces and one class:",[1107,2637,2639],{"className":1109,"code":2638,"language":1111,"meta":1112,"style":1112},"interface Aimable\n{\n    void aimAt(double degrees);\n}\n\ninterface Reportable\n{\n    String getReport();\n\n    default void printReport()\n    {\n        System.out.println(getReport());\n    }\n}\n\nclass Turret implements Aimable, Reportable\n{\n    private double angle;\n\n    @Override\n    public void aimAt(double degrees)\n    {\n        angle = degrees;\n    }\n\n    @Override\n    public String getReport()\n    {\n        return \"Turret at \" + angle + \" degrees\";\n    }\n}\n",[1114,2640,2641,2646,2650,2655,2659,2663,2668,2672,2677,2681,2686,2690,2695,2699,2703,2707,2712,2716,2721,2725,2729,2734,2738,2743,2747,2751,2755,2760,2764,2769,2773],{"__ignoreMap":1112},[1117,2642,2643],{"class":1119,"line":1120},[1117,2644,2645],{},"interface Aimable\n",[1117,2647,2648],{"class":1119,"line":1126},[1117,2649,1129],{},[1117,2651,2652],{"class":1119,"line":1132},[1117,2653,2654],{},"    void aimAt(double degrees);\n",[1117,2656,2657],{"class":1119,"line":1138},[1117,2658,1147],{},[1117,2660,2661],{"class":1119,"line":1144},[1117,2662,1187],{"emptyLinePlaceholder":1186},[1117,2664,2665],{"class":1119,"line":1190},[1117,2666,2667],{},"interface Reportable\n",[1117,2669,2670],{"class":1119,"line":1195},[1117,2671,1129],{},[1117,2673,2674],{"class":1119,"line":1201},[1117,2675,2676],{},"    String getReport();\n",[1117,2678,2679],{"class":1119,"line":1430},[1117,2680,1187],{"emptyLinePlaceholder":1186},[1117,2682,2683],{"class":1119,"line":1510},[1117,2684,2685],{},"    default void printReport()\n",[1117,2687,2688],{"class":1119,"line":1516},[1117,2689,1497],{},[1117,2691,2692],{"class":1119,"line":2017},[1117,2693,2694],{},"        System.out.println(getReport());\n",[1117,2696,2697],{"class":1119,"line":2022},[1117,2698,1513],{},[1117,2700,2701],{"class":1119,"line":2028},[1117,2702,1147],{},[1117,2704,2705],{"class":1119,"line":2033},[1117,2706,1187],{"emptyLinePlaceholder":1186},[1117,2708,2709],{"class":1119,"line":2038},[1117,2710,2711],{},"class Turret implements Aimable, Reportable\n",[1117,2713,2714],{"class":1119,"line":2043},[1117,2715,1129],{},[1117,2717,2718],{"class":1119,"line":2049},[1117,2719,2720],{},"    private double angle;\n",[1117,2722,2723],{"class":1119,"line":2054},[1117,2724,1187],{"emptyLinePlaceholder":1186},[1117,2726,2727],{"class":1119,"line":2060},[1117,2728,1176],{},[1117,2730,2731],{"class":1119,"line":2065},[1117,2732,2733],{},"    public void aimAt(double degrees)\n",[1117,2735,2736],{"class":1119,"line":2071},[1117,2737,1497],{},[1117,2739,2740],{"class":1119,"line":2076},[1117,2741,2742],{},"        angle = degrees;\n",[1117,2744,2745],{"class":1119,"line":2082},[1117,2746,1513],{},[1117,2748,2749],{"class":1119,"line":2087},[1117,2750,1187],{"emptyLinePlaceholder":1186},[1117,2752,2753],{"class":1119,"line":2092},[1117,2754,1176],{},[1117,2756,2757],{"class":1119,"line":2097},[1117,2758,2759],{},"    public String getReport()\n",[1117,2761,2762],{"class":1119,"line":2102},[1117,2763,1497],{},[1117,2765,2766],{"class":1119,"line":2107},[1117,2767,2768],{},"        return \"Turret at \" + angle + \" degrees\";\n",[1117,2770,2771],{"class":1119,"line":2113},[1117,2772,1513],{},[1117,2774,2775],{"class":1119,"line":2118},[1117,2776,1147],{},[1085,2778,2779,2782,2783,2786],{},[1114,2780,2781],{},"Turret"," never writes a ",[1114,2784,2785],{},"printReport()"," method. What happens?",[1085,2788,2789],{},[1089,2790,2791],{},"Options:",[1721,2793,2794,2807,2810,2822],{},[1724,2795,2796,2797,2799,2800,2802,2803,2806],{},"A. It doesn't compile — ",[1114,2798,2781],{}," is missing ",[1114,2801,2785],{},", which ",[1114,2804,2805],{},"Reportable"," declares",[1724,2808,2809],{},"B. It doesn't compile — a class can only implement one interface",[1724,2811,2812,2813,2815,2816,2818,2819,2821],{},"C. It compiles, and ",[1114,2814,2781],{}," inherits ",[1114,2817,2785],{}," from ",[1114,2820,2805],{},"'s default method",[1724,2823,2824,2825,2827,2828,2830,2831,2833],{},"D. It compiles, but calling ",[1114,2826,2785],{}," on a ",[1114,2829,2781],{}," crashes at runtime because ",[1114,2832,2781],{}," never wrote it",[1085,2835,2836,2839],{},[1089,2837,2838],{},"Answer:"," C",[1085,2841,2842,2845,2846,2848,2849,2818,2852,1450,2855,2818,2858,2860,2861,2863,2864,2866,2867,2869,2870,2872],{},[1089,2843,2844],{},"Why:"," ",[1114,2847,2781],{}," implements both interfaces, and it provides a body for every abstract method they declare: ",[1114,2850,2851],{},"aimAt(double)",[1114,2853,2854],{},"Aimable",[1114,2856,2857],{},"getReport()",[1114,2859,2805],{},". ",[1114,2862,2785],{}," isn't abstract — it's a ",[1114,2865,1461],{}," method with its own body inside ",[1114,2868,2805],{}," — so ",[1114,2871,2781],{}," inherits it automatically and doesn't have to write it.",[1721,2874,2875,2881,2890],{},[1724,2876,2877,2878,2880],{},"A is wrong — only abstract (no-body) methods are required. A ",[1114,2879,1461],{}," method already has a body, so implementing classes get it for free.",[1724,2882,2883,2884,2886,2887,2889],{},"B is wrong — that's the rule for ",[1114,2885,1246],{}," (exactly one superclass). A class can ",[1114,2888,1156],{}," as many interfaces as it needs, comma-separated.",[1724,2891,2892,2893,2895,2896,2899,2900,1236],{},"D is wrong — the inherited default is a real method with a real body. Calling it on a ",[1114,2894,2781],{}," would print that turret's report, e.g. ",[1114,2897,2898],{},"Turret at 30.0 degrees"," after ",[1114,2901,2902],{},"aimAt(30.0)",[1080,2904,2906],{"id":2905},"micro-parsons","Micro-Parsons",[1085,2908,2909,2912,2913,2916,2917,2919,2920,2923,2924,2926,2927,2929,2930,2933,2934,1236],{},[1089,2910,2911],{},"Problem:"," Given this ",[1114,2914,2915],{},"Scorer"," interface and ",[1114,2918,2532],{}," method, reorder the fragments below into the ",[1114,2921,2922],{},"SpeakerShot"," class that goes where the comment is. ",[1114,2925,2922],{}," must implement the ",[1114,2928,2915],{}," contract, returning ",[1114,2931,2932],{},"2"," points, so the program prints ",[1114,2935,2936],{},"Points: 2",[1107,2938,2940],{"className":1109,"code":2939,"language":1111,"meta":1112,"style":1112},"public class ScoreTest\n{\n    public static void main(String[] args)\n    {\n        Scorer shot = new SpeakerShot();\n        System.out.println(\"Points: \" + shot.getPoints());\n    }\n}\n\ninterface Scorer\n{\n    int getPoints();\n}\n\n\u002F\u002F SpeakerShot class goes here\n",[1114,2941,2942,2947,2951,2955,2959,2964,2969,2973,2977,2981,2986,2990,2995,2999,3003],{"__ignoreMap":1112},[1117,2943,2944],{"class":1119,"line":1120},[1117,2945,2946],{},"public class ScoreTest\n",[1117,2948,2949],{"class":1119,"line":1126},[1117,2950,1129],{},[1117,2952,2953],{"class":1119,"line":1132},[1117,2954,2294],{},[1117,2956,2957],{"class":1119,"line":1138},[1117,2958,1497],{},[1117,2960,2961],{"class":1119,"line":1144},[1117,2962,2963],{},"        Scorer shot = new SpeakerShot();\n",[1117,2965,2966],{"class":1119,"line":1190},[1117,2967,2968],{},"        System.out.println(\"Points: \" + shot.getPoints());\n",[1117,2970,2971],{"class":1119,"line":1195},[1117,2972,1513],{},[1117,2974,2975],{"class":1119,"line":1201},[1117,2976,1147],{},[1117,2978,2979],{"class":1119,"line":1430},[1117,2980,1187],{"emptyLinePlaceholder":1186},[1117,2982,2983],{"class":1119,"line":1510},[1117,2984,2985],{},"interface Scorer\n",[1117,2987,2988],{"class":1119,"line":1516},[1117,2989,1129],{},[1117,2991,2992],{"class":1119,"line":2017},[1117,2993,2994],{},"    int getPoints();\n",[1117,2996,2997],{"class":1119,"line":2022},[1117,2998,1147],{},[1117,3000,3001],{"class":1119,"line":2028},[1117,3002,1187],{"emptyLinePlaceholder":1186},[1117,3004,3005],{"class":1119,"line":2033},[1117,3006,3007],{},"\u002F\u002F SpeakerShot class goes here\n",[1085,3009,3010,3011,3014,3015,2536,3017,2540],{},"(",[1114,3012,3013],{},"ScoreTest",", the public class with ",[1114,3016,2532],{},[1114,3018,2539],{},[1085,3020,3021],{},"Reorder the fragments below to complete it:",[1721,3023,3024,3030,3036,3042,3048,3054,3060,3066],{},[1724,3025,3026,3027],{},"a. ",[1114,3028,3029],{},"    {",[1724,3031,3032,3033],{},"b. ",[1114,3034,3035],{},"class SpeakerShot implements Scorer",[1724,3037,3038,3039],{},"c. ",[1114,3040,3041],{},"    }",[1724,3043,3044,3045],{},"d. ",[1114,3046,3047],{},"        return 2;",[1724,3049,3050,3051],{},"e. ",[1114,3052,3053],{},"}",[1724,3055,3056,3057],{},"f. ",[1114,3058,3059],{},"    public int getPoints()",[1724,3061,3062,3063],{},"g. ",[1114,3064,3065],{},"{",[1724,3067,3068,3069],{},"h. ",[1114,3070,3071],{},"    @Override",[1085,3073,3074,3076],{},[1089,3075,2838],{}," b, g, h, f, a, d, c, e",[1107,3078,3080],{"className":1109,"code":3079,"language":1111,"meta":1112,"style":1112},"public class ScoreTest\n{\n    public static void main(String[] args)\n    {\n        Scorer shot = new SpeakerShot();\n        System.out.println(\"Points: \" + shot.getPoints());\n    }\n}\n\ninterface Scorer\n{\n    int getPoints();\n}\n\nclass SpeakerShot implements Scorer\n{\n    @Override\n    public int getPoints()\n    {\n        return 2;\n    }\n}\n",[1114,3081,3082,3086,3090,3094,3098,3102,3106,3110,3114,3118,3122,3126,3130,3134,3138,3143,3147,3151,3156,3160,3165,3169],{"__ignoreMap":1112},[1117,3083,3084],{"class":1119,"line":1120},[1117,3085,2946],{},[1117,3087,3088],{"class":1119,"line":1126},[1117,3089,1129],{},[1117,3091,3092],{"class":1119,"line":1132},[1117,3093,2294],{},[1117,3095,3096],{"class":1119,"line":1138},[1117,3097,1497],{},[1117,3099,3100],{"class":1119,"line":1144},[1117,3101,2963],{},[1117,3103,3104],{"class":1119,"line":1190},[1117,3105,2968],{},[1117,3107,3108],{"class":1119,"line":1195},[1117,3109,1513],{},[1117,3111,3112],{"class":1119,"line":1201},[1117,3113,1147],{},[1117,3115,3116],{"class":1119,"line":1430},[1117,3117,1187],{"emptyLinePlaceholder":1186},[1117,3119,3120],{"class":1119,"line":1510},[1117,3121,2985],{},[1117,3123,3124],{"class":1119,"line":1516},[1117,3125,1129],{},[1117,3127,3128],{"class":1119,"line":2017},[1117,3129,2994],{},[1117,3131,3132],{"class":1119,"line":2022},[1117,3133,1147],{},[1117,3135,3136],{"class":1119,"line":2028},[1117,3137,1187],{"emptyLinePlaceholder":1186},[1117,3139,3140],{"class":1119,"line":2033},[1117,3141,3142],{},"class SpeakerShot implements Scorer\n",[1117,3144,3145],{"class":1119,"line":2038},[1117,3146,1129],{},[1117,3148,3149],{"class":1119,"line":2043},[1117,3150,1176],{},[1117,3152,3153],{"class":1119,"line":2049},[1117,3154,3155],{},"    public int getPoints()\n",[1117,3157,3158],{"class":1119,"line":2054},[1117,3159,1497],{},[1117,3161,3162],{"class":1119,"line":2060},[1117,3163,3164],{},"        return 2;\n",[1117,3166,3167],{"class":1119,"line":2065},[1117,3168,1513],{},[1117,3170,3171],{"class":1119,"line":2071},[1117,3172,1147],{},[1085,3174,3175,3178,3179,3182,3183,3186,3187,3189,3190,3192,3193,3195,3196,3199,3200,3203,3204,3207,3208,3211,3212,3215,3216,3218,3219,3222,3223,3226,3227,3230,3231,3234,3235,3238,3239,3241,3242,3244,3245,3247],{},[1089,3176,3177],{},"Why this order:"," The class declaration (",[1114,3180,3181],{},"b",") comes first — ",[1114,3184,3185],{},"implements Scorer"," is what signs the contract, and it's also what lets ",[1114,3188,2532],{}," store a ",[1114,3191,2922],{}," in a ",[1114,3194,2915],{},"-typed variable. The class's opening brace (",[1114,3197,3198],{},"g",") follows. ",[1114,3201,3202],{},"@Override"," (",[1114,3205,3206],{},"h",") goes directly above the method signature (",[1114,3209,3210],{},"f","), which has to match the interface's ",[1114,3213,3214],{},"int getPoints()"," — without this method, ",[1114,3217,2922],{}," would be missing a required part of the contract and wouldn't compile. The method's opening brace (",[1114,3220,3221],{},"a","), its ",[1114,3224,3225],{},"return"," statement (",[1114,3228,3229],{},"d","), and its closing brace (",[1114,3232,3233],{},"c",") follow, and the class's closing brace (",[1114,3236,3237],{},"e",") comes last. ",[1114,3240,3013],{}," and the ",[1114,3243,2915],{}," interface are the given scaffold, with ",[1114,3246,2922],{}," inserted where the comment was.",[1080,3249,3251],{"id":3250},"coding","Coding",[1085,3253,3254,3257],{},[1089,3255,3256],{},"Mode:"," full-program",[1085,3259,3260,3262,3263,3265,3266,3269,3270,3272],{},[1089,3261,2911],{}," The intake's hardware layer is a contract. Write the interface ",[1114,3264,1217],{}," and the class ",[1114,3267,3268],{},"SimIntakeIO"," that\nimplements it, so the fixed ",[1114,3271,2532],{}," below works.",[1085,3274,3275,3277],{},[1114,3276,1217],{}," must declare:",[1721,3279,3280,3290,3296,3313],{},[1724,3281,3282,3283,3286,3287],{},"a constant ",[1114,3284,3285],{},"MAX_VOLTS"," equal to ",[1114,3288,3289],{},"12.0",[1724,3291,3292,3293],{},"one abstract method ",[1114,3294,3295],{},"void setVoltage(double volts)",[1724,3297,3298,3299,3301,3302,3305,3306,3308,3309,3312],{},"a ",[1089,3300,1461],{}," method ",[1114,3303,3304],{},"void stop()"," that is built on ",[1114,3307,1525],{}," (it commands ",[1114,3310,3311],{},"0.0"," volts)",[1724,3314,3298,3315,3301,3317,3320,3321,3324,3325,3328,3329,3331,3332,3335,3336,1450,3338,3335,3341,3344],{},[1089,3316,1453],{},[1114,3318,3319],{},"double clampVolts(double v)"," that limits ",[1114,3322,3323],{},"v"," to the range ",[1114,3326,3327],{},"-MAX_VOLTS"," to ",[1114,3330,3285],{},"\n(so ",[1114,3333,3334],{},"14.0"," becomes ",[1114,3337,3289],{},[1114,3339,3340],{},"-20.0",[1114,3342,3343],{},"-12.0","; values already in range come back unchanged)",[1085,3346,3347,3350,3351,3354,3355,3357,3358,3360,3361,3364,3365,3368,3369,3371,3372,3374,3375,3377],{},[1114,3348,3349],{},"SimIntakeIO implements IntakeIO",". It remembers the most recent voltage it was given\n(",[1114,3352,3353],{},"double getLastVolts()",", which is ",[1114,3356,3311],{}," before any command) and counts how many times ",[1114,3359,1525],{}," has been\ncalled (",[1114,3362,3363],{},"int getCommandCount()","). It must ",[1089,3366,3367],{},"not"," write its own ",[1114,3370,1529],{},"; it inherits the default one, so\nthe ",[1114,3373,1529],{}," call in ",[1114,3376,2532],{}," counts as one more command.",[1085,3379,3380,3382],{},[1114,3381,2532],{}," reads a count, then that many voltages.",[1085,3384,3385],{},[1089,3386,3387],{},"Starter:",[1107,3389,3391],{"className":1109,"code":3390,"language":1111,"meta":1112,"style":1112},"import java.util.Scanner;\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        int count = in.nextInt();\n        SimIntakeIO sim = new SimIntakeIO();\n        IntakeIO io = sim; \u002F\u002F main only sees the contract\n        for (int i = 0; i \u003C count; i++)\n        {\n            double requested = in.nextDouble();\n            double applied = IntakeIO.clampVolts(requested);\n            io.setVoltage(applied);\n            System.out.println(\"Applied: \" + sim.getLastVolts());\n        }\n        io.stop();\n        System.out.println(\"After stop: \" + sim.getLastVolts());\n        System.out.println(\"Commands: \" + sim.getCommandCount());\n        System.out.println(\"Limit: \" + IntakeIO.MAX_VOLTS);\n    }\n}\n\n\u002F\u002F TODO: write the interface IntakeIO\n\n\u002F\u002F TODO: write the class SimIntakeIO\n",[1114,3392,3393,3398,3402,3407,3411,3416,3420,3425,3430,3435,3440,3445,3450,3455,3460,3465,3470,3475,3480,3485,3490,3495,3499,3503,3507,3512,3516],{"__ignoreMap":1112},[1117,3394,3395],{"class":1119,"line":1120},[1117,3396,3397],{},"import java.util.Scanner;\n",[1117,3399,3400],{"class":1119,"line":1126},[1117,3401,1187],{"emptyLinePlaceholder":1186},[1117,3403,3404],{"class":1119,"line":1132},[1117,3405,3406],{},"public class Main\n",[1117,3408,3409],{"class":1119,"line":1138},[1117,3410,1129],{},[1117,3412,3413],{"class":1119,"line":1144},[1117,3414,3415],{},"    public static void main(String[] args) \u002F\u002F Don't change main\n",[1117,3417,3418],{"class":1119,"line":1190},[1117,3419,1497],{},[1117,3421,3422],{"class":1119,"line":1195},[1117,3423,3424],{},"        Scanner in = new Scanner(System.in);\n",[1117,3426,3427],{"class":1119,"line":1201},[1117,3428,3429],{},"        int count = in.nextInt();\n",[1117,3431,3432],{"class":1119,"line":1430},[1117,3433,3434],{},"        SimIntakeIO sim = new SimIntakeIO();\n",[1117,3436,3437],{"class":1119,"line":1510},[1117,3438,3439],{},"        IntakeIO io = sim; \u002F\u002F main only sees the contract\n",[1117,3441,3442],{"class":1119,"line":1516},[1117,3443,3444],{},"        for (int i = 0; i \u003C count; i++)\n",[1117,3446,3447],{"class":1119,"line":2017},[1117,3448,3449],{},"        {\n",[1117,3451,3452],{"class":1119,"line":2022},[1117,3453,3454],{},"            double requested = in.nextDouble();\n",[1117,3456,3457],{"class":1119,"line":2028},[1117,3458,3459],{},"            double applied = IntakeIO.clampVolts(requested);\n",[1117,3461,3462],{"class":1119,"line":2033},[1117,3463,3464],{},"            io.setVoltage(applied);\n",[1117,3466,3467],{"class":1119,"line":2038},[1117,3468,3469],{},"            System.out.println(\"Applied: \" + sim.getLastVolts());\n",[1117,3471,3472],{"class":1119,"line":2043},[1117,3473,3474],{},"        }\n",[1117,3476,3477],{"class":1119,"line":2049},[1117,3478,3479],{},"        io.stop();\n",[1117,3481,3482],{"class":1119,"line":2054},[1117,3483,3484],{},"        System.out.println(\"After stop: \" + sim.getLastVolts());\n",[1117,3486,3487],{"class":1119,"line":2060},[1117,3488,3489],{},"        System.out.println(\"Commands: \" + sim.getCommandCount());\n",[1117,3491,3492],{"class":1119,"line":2065},[1117,3493,3494],{},"        System.out.println(\"Limit: \" + IntakeIO.MAX_VOLTS);\n",[1117,3496,3497],{"class":1119,"line":2071},[1117,3498,1513],{},[1117,3500,3501],{"class":1119,"line":2076},[1117,3502,1147],{},[1117,3504,3505],{"class":1119,"line":2082},[1117,3506,1187],{"emptyLinePlaceholder":1186},[1117,3508,3509],{"class":1119,"line":2087},[1117,3510,3511],{},"\u002F\u002F TODO: write the interface IntakeIO\n",[1117,3513,3514],{"class":1119,"line":2092},[1117,3515,1187],{"emptyLinePlaceholder":1186},[1117,3517,3518],{"class":1119,"line":2097},[1117,3519,3520],{},"\u002F\u002F TODO: write the class SimIntakeIO\n",[1085,3522,3523],{},[1089,3524,3525],{},"Scenario 1 (visible):",[1085,3527,3528],{},[1089,3529,3530],{},"Input:",[1107,3532,3535],{"className":3533,"code":3534,"language":2550,"meta":1112},[2548],"3\n6.5 14.0 3.0\n",[1114,3536,3534],{"__ignoreMap":1112},[1085,3538,3539],{},[1089,3540,3541],{},"Expected output:",[1107,3543,3546],{"className":3544,"code":3545,"language":2550,"meta":1112},[2548],"Applied: 6.5\nApplied: 12.0\nApplied: 3.0\nAfter stop: 0.0\nCommands: 4\nLimit: 12.0\n",[1114,3547,3545],{"__ignoreMap":1112},[1085,3549,3550],{},[1089,3551,3552],{},"Scenario 2 (visible):",[1085,3554,3555],{},[1089,3556,3530],{},[1107,3558,3561],{"className":3559,"code":3560,"language":2550,"meta":1112},[2548],"2\n-4.0 0.0\n",[1114,3562,3560],{"__ignoreMap":1112},[1085,3564,3565],{},[1089,3566,3541],{},[1107,3568,3571],{"className":3569,"code":3570,"language":2550,"meta":1112},[2548],"Applied: -4.0\nApplied: 0.0\nAfter stop: 0.0\nCommands: 3\nLimit: 12.0\n",[1114,3572,3570],{"__ignoreMap":1112},[1085,3574,3575],{},[1089,3576,3577],{},"Scenario 3 (visible):",[1085,3579,3580],{},[1089,3581,3530],{},[1107,3583,3586],{"className":3584,"code":3585,"language":2550,"meta":1112},[2548],"1\n12.0\n",[1114,3587,3585],{"__ignoreMap":1112},[1085,3589,3590],{},[1089,3591,3541],{},[1107,3593,3596],{"className":3594,"code":3595,"language":2550,"meta":1112},[2548],"Applied: 12.0\nAfter stop: 0.0\nCommands: 2\nLimit: 12.0\n",[1114,3597,3595],{"__ignoreMap":1112},[1085,3599,3600],{},[1089,3601,3602],{},"Scenario 4 (hidden):",[1085,3604,3605],{},[1089,3606,3530],{},[1107,3608,3611],{"className":3609,"code":3610,"language":2550,"meta":1112},[2548],"3\n-20.0 20.0 -12.0\n",[1114,3612,3610],{"__ignoreMap":1112},[1085,3614,3615],{},[1089,3616,3541],{},[1107,3618,3621],{"className":3619,"code":3620,"language":2550,"meta":1112},[2548],"Applied: -12.0\nApplied: 12.0\nApplied: -12.0\nAfter stop: 0.0\nCommands: 4\nLimit: 12.0\n",[1114,3622,3620],{"__ignoreMap":1112},[1085,3624,3625],{},[1089,3626,3627],{},"Scenario 5 (hidden):",[1085,3629,3630],{},[1089,3631,3530],{},[1107,3633,3636],{"className":3634,"code":3635,"language":2550,"meta":1112},[2548],"1\n-13.5\n",[1114,3637,3635],{"__ignoreMap":1112},[1085,3639,3640],{},[1089,3641,3541],{},[1107,3643,3646],{"className":3644,"code":3645,"language":2550,"meta":1112},[2548],"Applied: -12.0\nAfter stop: 0.0\nCommands: 2\nLimit: 12.0\n",[1114,3647,3645],{"__ignoreMap":1112},[1085,3649,3650],{},[1089,3651,3652],{},"Scenario 6 (hidden):",[1085,3654,3655],{},[1089,3656,3530],{},[1107,3658,3661],{"className":3659,"code":3660,"language":2550,"meta":1112},[2548],"0\n",[1114,3662,3660],{"__ignoreMap":1112},[1085,3664,3665],{},[1089,3666,3541],{},[1107,3668,3671],{"className":3669,"code":3670,"language":2550,"meta":1112},[2548],"After stop: 0.0\nCommands: 1\nLimit: 12.0\n",[1114,3672,3670],{"__ignoreMap":1112},[1085,3674,3675],{},[1089,3676,3677],{},"Solution:",[1107,3679,3681],{"className":1109,"code":3680,"language":1111,"meta":1112,"style":1112},"import java.util.Scanner;\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        int count = in.nextInt();\n        SimIntakeIO sim = new SimIntakeIO();\n        IntakeIO io = sim; \u002F\u002F main only sees the contract\n        for (int i = 0; i \u003C count; i++)\n        {\n            double requested = in.nextDouble();\n            double applied = IntakeIO.clampVolts(requested);\n            io.setVoltage(applied);\n            System.out.println(\"Applied: \" + sim.getLastVolts());\n        }\n        io.stop();\n        System.out.println(\"After stop: \" + sim.getLastVolts());\n        System.out.println(\"Commands: \" + sim.getCommandCount());\n        System.out.println(\"Limit: \" + IntakeIO.MAX_VOLTS);\n    }\n}\n\ninterface IntakeIO\n{\n    double MAX_VOLTS = 12.0;\n\n    void setVoltage(double volts);\n\n    default void stop()\n    {\n        setVoltage(0.0);\n    }\n\n    static double clampVolts(double v)\n    {\n        return Math.max(-MAX_VOLTS, Math.min(MAX_VOLTS, v));\n    }\n}\n\nclass SimIntakeIO implements IntakeIO\n{\n    private double lastVolts = 0.0;\n    private int commandCount = 0;\n\n    @Override\n    public void setVoltage(double volts)\n    {\n        lastVolts = volts;\n        commandCount++;\n    }\n\n    public double getLastVolts()\n    {\n        return lastVolts;\n    }\n\n    public int getCommandCount()\n    {\n        return commandCount;\n    }\n}\n",[1114,3682,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,3784,3788,3792,3796,3800,3804,3808,3812,3816,3820,3824,3828,3832,3837,3841,3845,3849,3854,3858,3863,3868,3872,3876,3881,3885,3890,3895,3899,3903,3908,3912,3917,3921,3925,3930,3935,3941,3946],{"__ignoreMap":1112},[1117,3684,3685],{"class":1119,"line":1120},[1117,3686,3397],{},[1117,3688,3689],{"class":1119,"line":1126},[1117,3690,1187],{"emptyLinePlaceholder":1186},[1117,3692,3693],{"class":1119,"line":1132},[1117,3694,3406],{},[1117,3696,3697],{"class":1119,"line":1138},[1117,3698,1129],{},[1117,3700,3701],{"class":1119,"line":1144},[1117,3702,3415],{},[1117,3704,3705],{"class":1119,"line":1190},[1117,3706,1497],{},[1117,3708,3709],{"class":1119,"line":1195},[1117,3710,3424],{},[1117,3712,3713],{"class":1119,"line":1201},[1117,3714,3429],{},[1117,3716,3717],{"class":1119,"line":1430},[1117,3718,3434],{},[1117,3720,3721],{"class":1119,"line":1510},[1117,3722,3439],{},[1117,3724,3725],{"class":1119,"line":1516},[1117,3726,3444],{},[1117,3728,3729],{"class":1119,"line":2017},[1117,3730,3449],{},[1117,3732,3733],{"class":1119,"line":2022},[1117,3734,3454],{},[1117,3736,3737],{"class":1119,"line":2028},[1117,3738,3459],{},[1117,3740,3741],{"class":1119,"line":2033},[1117,3742,3464],{},[1117,3744,3745],{"class":1119,"line":2038},[1117,3746,3469],{},[1117,3748,3749],{"class":1119,"line":2043},[1117,3750,3474],{},[1117,3752,3753],{"class":1119,"line":2049},[1117,3754,3479],{},[1117,3756,3757],{"class":1119,"line":2054},[1117,3758,3484],{},[1117,3760,3761],{"class":1119,"line":2060},[1117,3762,3489],{},[1117,3764,3765],{"class":1119,"line":2065},[1117,3766,3494],{},[1117,3768,3769],{"class":1119,"line":2071},[1117,3770,1513],{},[1117,3772,3773],{"class":1119,"line":2076},[1117,3774,1147],{},[1117,3776,3777],{"class":1119,"line":2082},[1117,3778,1187],{"emptyLinePlaceholder":1186},[1117,3780,3781],{"class":1119,"line":2087},[1117,3782,3783],{},"interface IntakeIO\n",[1117,3785,3786],{"class":1119,"line":2092},[1117,3787,1129],{},[1117,3789,3790],{"class":1119,"line":2097},[1117,3791,1351],{},[1117,3793,3794],{"class":1119,"line":2102},[1117,3795,1187],{"emptyLinePlaceholder":1186},[1117,3797,3798],{"class":1119,"line":2107},[1117,3799,1141],{},[1117,3801,3802],{"class":1119,"line":2113},[1117,3803,1187],{"emptyLinePlaceholder":1186},[1117,3805,3806],{"class":1119,"line":2118},[1117,3807,1492],{},[1117,3809,3810],{"class":1119,"line":2389},[1117,3811,1497],{},[1117,3813,3814],{"class":1119,"line":2394},[1117,3815,1507],{},[1117,3817,3818],{"class":1119,"line":2399},[1117,3819,1513],{},[1117,3821,3822],{"class":1119,"line":2404},[1117,3823,1187],{"emptyLinePlaceholder":1186},[1117,3825,3826],{"class":1119,"line":2409},[1117,3827,1561],{},[1117,3829,3830],{"class":1119,"line":2414},[1117,3831,1497],{},[1117,3833,3834],{"class":1119,"line":2419},[1117,3835,3836],{},"        return Math.max(-MAX_VOLTS, Math.min(MAX_VOLTS, v));\n",[1117,3838,3839],{"class":1119,"line":2424},[1117,3840,1513],{},[1117,3842,3843],{"class":1119,"line":2429},[1117,3844,1147],{},[1117,3846,3847],{"class":1119,"line":2434},[1117,3848,1187],{"emptyLinePlaceholder":1186},[1117,3850,3851],{"class":1119,"line":2439},[1117,3852,3853],{},"class SimIntakeIO implements IntakeIO\n",[1117,3855,3856],{"class":1119,"line":2444},[1117,3857,1129],{},[1117,3859,3860],{"class":1119,"line":2449},[1117,3861,3862],{},"    private double lastVolts = 0.0;\n",[1117,3864,3865],{"class":1119,"line":2454},[1117,3866,3867],{},"    private int commandCount = 0;\n",[1117,3869,3870],{"class":1119,"line":2459},[1117,3871,1187],{"emptyLinePlaceholder":1186},[1117,3873,3874],{"class":1119,"line":2464},[1117,3875,1176],{},[1117,3877,3878],{"class":1119,"line":2469},[1117,3879,3880],{},"    public void setVoltage(double volts)\n",[1117,3882,3883],{"class":1119,"line":2474},[1117,3884,1497],{},[1117,3886,3887],{"class":1119,"line":2479},[1117,3888,3889],{},"        lastVolts = volts;\n",[1117,3891,3892],{"class":1119,"line":2484},[1117,3893,3894],{},"        commandCount++;\n",[1117,3896,3897],{"class":1119,"line":2489},[1117,3898,1513],{},[1117,3900,3901],{"class":1119,"line":2494},[1117,3902,1187],{"emptyLinePlaceholder":1186},[1117,3904,3905],{"class":1119,"line":2499},[1117,3906,3907],{},"    public double getLastVolts()\n",[1117,3909,3910],{"class":1119,"line":2504},[1117,3911,1497],{},[1117,3913,3914],{"class":1119,"line":2509},[1117,3915,3916],{},"        return lastVolts;\n",[1117,3918,3919],{"class":1119,"line":2514},[1117,3920,1513],{},[1117,3922,3923],{"class":1119,"line":2519},[1117,3924,1187],{"emptyLinePlaceholder":1186},[1117,3926,3927],{"class":1119,"line":2524},[1117,3928,3929],{},"    public int getCommandCount()\n",[1117,3931,3933],{"class":1119,"line":3932},60,[1117,3934,1497],{},[1117,3936,3938],{"class":1119,"line":3937},61,[1117,3939,3940],{},"        return commandCount;\n",[1117,3942,3944],{"class":1119,"line":3943},62,[1117,3945,1513],{},[1117,3947,3949],{"class":1119,"line":3948},63,[1117,3950,1147],{},[1085,3952,3953,3955,3956,3958,3959,3961,3962,3964,3965,3967,3968,3970,3971,3973,3974,3976,3977,2845,3980,3982,3983,3985,3986,3988,3989,3992],{},[1089,3954,2844],{}," The interface holds all four kinds of member Lesson 19 covers: an implicitly ",[1114,3957,1327],{}," constant, an abstract\nmethod every implementer must supply, a ",[1114,3960,1461],{}," method that builds on that abstract method, and a ",[1114,3963,1453],{}," method called on\nthe interface name. ",[1114,3966,3268],{}," must write ",[1114,3969,1525],{}," as ",[1114,3972,1213],{}," (interface methods are implicitly public) and gets ",[1114,3975,1529],{}," for free,\nwhich calls ",[1094,3978,3979],{},"its own",[1114,3981,1525],{},", so the command count goes up. Typical mistakes: a ",[1114,3984,1529],{}," that doesn't call ",[1114,3987,1525],{}," (the last voltage and the\ncommand count come out wrong), and a ",[1114,3990,3991],{},"clampVolts"," that only limits the top end, which fails on a large negative voltage.",[1868,3994,1870],{},{"title":1112,"searchDepth":1126,"depth":1126,"links":3996},[3997,3998,3999],{"id":2628,"depth":1126,"text":2629},{"id":2905,"depth":1126,"text":2906},{"id":3250,"depth":1126,"text":3251},{"outlineRef":1886,"pairsWith":2615,"status":4001},"new — authored exercises (Multiple Choice + Micro-Parsons + Coding)",{"title":988,"description":1112},"StHCHT1aeEzb61hDMdVOXyQmTY4fXag-hsxP9ID8iCE",1792718166159]