[{"data":1,"prerenderedAt":3583},["ShallowReactive",2],{"item-lessons-light-ch12-exceptions-and-try-catch":3,"item-examples-light-ch12-exceptions-and-try-catch":444,"item-exercises-light-ch12-exceptions-and-try-catch":753,"item-lesson-full-ch12-exceptions-and-try-catch-12":1070,"item-example-full-ch12-exceptions-and-try-catch-12":2003,"item-exercise-full-ch12-exceptions-and-try-catch-12":2602},[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":190,"body":1072,"description":1141,"extension":1996,"meta":1997,"navigation":2000,"path":189,"seo":2001,"stem":191,"__hash__":2002},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch.md",{"type":1073,"value":1074,"toc":1982},"minimark",[1075,1079,1084,1101,1121,1125,1135,1204,1224,1232,1292,1307,1317,1339,1360,1363,1375,1463,1466,1493,1531,1546,1550,1553,1601,1614,1620,1633,1669,1688,1695,1705,1746,1768,1772,1775,1798,1816,1824,1831,1842,1846,1896,1900,1951,1978],[1076,1077,190],"h1",{"id":1078},"exceptions-trycatch",[1080,1081,1083],"h2",{"id":1082},"what-an-exception-is","What an Exception Is",[1085,1086,1087,1088,1092,1093,1096,1097,1100],"p",{},"An ",[1089,1090,1091],"strong",{},"exception"," is an \"exceptional event\" — something that disrupts a program's normal flow while it runs (a file that doesn't exist, an array index that's out of range, dividing by zero). When an error occurs, the method creates an ",[1089,1094,1095],{},"exception object"," describing what went wrong and hands it to the Java runtime — this is called ",[1089,1098,1099],{},"throwing"," the exception.",[1085,1102,1103,1104,1107,1108,1111,1112,1115,1116,1120],{},"The runtime then searches back up the ",[1089,1105,1106],{},"call stack"," (the chain of methods that led to this point) looking for an ",[1089,1109,1110],{},"exception handler"," — a block of code able to deal with that type of exception. The first matching handler it finds is said to ",[1089,1113,1114],{},"catch"," the exception. If nothing on the whole call stack can handle it, the runtime terminates the program: on a robot, an uncaught exception in ",[1117,1118,1119],"code",{},"periodic()"," is exactly what turns the Driver Station's \"Robot Code\" indicator red.",[1080,1122,1124],{"id":1123},"try-catch","try \u002F catch",[1085,1126,1127,1128,1131,1132,1134],{},"A ",[1117,1129,1130],{},"try"," block wraps code that might throw; a ",[1117,1133,1114],{}," block that follows it handles a specific exception type if one occurs:",[1136,1137,1142],"pre",{"className":1138,"code":1139,"language":1140,"meta":1141,"style":1141},"language-java shiki shiki-themes github-light github-dark","try\n{\n    config = loadFromFile(\"tuning.json\");\n}\ncatch (IOException e)\n{\n    \u002F\u002F Recover: fall back to defaults\n    config = Config.defaults();\n    reportWarning(\"Using default tuning\");\n}\n","java","",[1117,1143,1144,1152,1158,1164,1170,1176,1181,1187,1193,1199],{"__ignoreMap":1141},[1145,1146,1149],"span",{"class":1147,"line":1148},"line",1,[1145,1150,1151],{},"try\n",[1145,1153,1155],{"class":1147,"line":1154},2,[1145,1156,1157],{},"{\n",[1145,1159,1161],{"class":1147,"line":1160},3,[1145,1162,1163],{},"    config = loadFromFile(\"tuning.json\");\n",[1145,1165,1167],{"class":1147,"line":1166},4,[1145,1168,1169],{},"}\n",[1145,1171,1173],{"class":1147,"line":1172},5,[1145,1174,1175],{},"catch (IOException e)\n",[1145,1177,1179],{"class":1147,"line":1178},6,[1145,1180,1157],{},[1145,1182,1184],{"class":1147,"line":1183},7,[1145,1185,1186],{},"    \u002F\u002F Recover: fall back to defaults\n",[1145,1188,1190],{"class":1147,"line":1189},8,[1145,1191,1192],{},"    config = Config.defaults();\n",[1145,1194,1196],{"class":1147,"line":1195},9,[1145,1197,1198],{},"    reportWarning(\"Using default tuning\");\n",[1145,1200,1202],{"class":1147,"line":1201},10,[1145,1203,1169],{},[1085,1205,1206,1207,1210,1211,1214,1215,1217,1218,1220,1221,1223],{},"If ",[1117,1208,1209],{},"loadFromFile"," throws an ",[1117,1212,1213],{},"IOException",", execution jumps straight into the matching ",[1117,1216,1114],{}," block — the rest of the ",[1117,1219,1130],{}," block is skipped. If no exception occurs, the ",[1117,1222,1114],{}," block never runs at all.",[1085,1225,1127,1226,1228,1229,1231],{},[1117,1227,1130],{}," can have multiple ",[1117,1230,1114],{}," blocks, checked in order, for handling different exception types differently:",[1136,1233,1235],{"className":1138,"code":1234,"language":1140,"meta":1141,"style":1141},"try\n{\n    camera = new UsbCamera(\"Camera 1\", 0);\n}\ncatch (VideoException e)\n{\n    reportWarning(\"Camera unavailable — skipping vision this match\");\n}\ncatch (NullPointerException e)\n{\n    reportWarning(\"Camera name was null\");\n}\n",[1117,1236,1237,1241,1245,1250,1254,1259,1263,1268,1272,1277,1281,1287],{"__ignoreMap":1141},[1145,1238,1239],{"class":1147,"line":1148},[1145,1240,1151],{},[1145,1242,1243],{"class":1147,"line":1154},[1145,1244,1157],{},[1145,1246,1247],{"class":1147,"line":1160},[1145,1248,1249],{},"    camera = new UsbCamera(\"Camera 1\", 0);\n",[1145,1251,1252],{"class":1147,"line":1166},[1145,1253,1169],{},[1145,1255,1256],{"class":1147,"line":1172},[1145,1257,1258],{},"catch (VideoException e)\n",[1145,1260,1261],{"class":1147,"line":1178},[1145,1262,1157],{},[1145,1264,1265],{"class":1147,"line":1183},[1145,1266,1267],{},"    reportWarning(\"Camera unavailable — skipping vision this match\");\n",[1145,1269,1270],{"class":1147,"line":1189},[1145,1271,1169],{},[1145,1273,1274],{"class":1147,"line":1195},[1145,1275,1276],{},"catch (NullPointerException e)\n",[1145,1278,1279],{"class":1147,"line":1201},[1145,1280,1157],{},[1145,1282,1284],{"class":1147,"line":1283},11,[1145,1285,1286],{},"    reportWarning(\"Camera name was null\");\n",[1145,1288,1290],{"class":1147,"line":1289},12,[1145,1291,1169],{},[1085,1293,1294,1297,1298,1302,1303,1306],{},[1117,1295,1296],{},"VideoException"," is ",[1299,1300,1301],"em",{},"unchecked"," — it extends ",[1117,1304,1305],{},"RuntimeException"," — so catching it here is optional, not compiler-required. Catching it anyway lets the robot keep running with vision disabled instead of crashing outright.",[1085,1308,1309,1310,1312,1313,1316],{},"Two ",[1117,1311,1114],{}," blocks for exception types that share no inheritance relationship can be combined into one with ",[1117,1314,1315],{},"|"," (multi-catch), when they should be handled identically:",[1136,1318,1320],{"className":1138,"code":1319,"language":1140,"meta":1141,"style":1141},"catch (VideoException | NullPointerException e)\n{\n    reportWarning(\"Camera unavailable — skipping vision this match\");\n}\n",[1117,1321,1322,1327,1331,1335],{"__ignoreMap":1141},[1145,1323,1324],{"class":1147,"line":1148},[1145,1325,1326],{},"catch (VideoException | NullPointerException e)\n",[1145,1328,1329],{"class":1147,"line":1154},[1145,1330,1157],{},[1145,1332,1333],{"class":1147,"line":1160},[1145,1334,1267],{},[1145,1336,1337],{"class":1147,"line":1166},[1145,1338,1169],{},[1085,1340,1341,1342,1345,1346,1348,1349,1352,1353,1356,1357,1359],{},"Order matters when the types ",[1299,1343,1344],{},"do"," relate: a ",[1117,1347,1114],{}," for a more general type (like ",[1117,1350,1351],{},"Exception",") must come ",[1299,1354,1355],{},"after"," every more specific ",[1117,1358,1114],{}," for one of its subclasses — putting the general one first makes the specific one unreachable, which is a compile error (\"exception X has already been caught\").",[1080,1361,1362],{"id":1362},"finally",[1085,1364,1365,1366,1368,1369,1371,1372,1374],{},"An optional ",[1117,1367,1362],{}," block, after all the ",[1117,1370,1114],{}," blocks, always runs — whether an exception was thrown or not, and even if the ",[1117,1373,1114],{}," block itself returns early. It's the right place for cleanup that must happen no matter what (closing a file, releasing a resource):",[1136,1376,1378],{"className":1138,"code":1377,"language":1140,"meta":1141,"style":1141},"Scanner scan = null;\ntry\n{\n    scan = new Scanner(new File(\"auto_config.csv\"));\n    \u002F\u002F ... read the file ...\n}\ncatch (FileNotFoundException e)\n{\n    reportWarning(\"Missing auto_config.csv — using default route\");\n}\nfinally\n{\n    if (scan != null)\n    {\n        scan.close(); \u002F\u002F runs whether the try succeeded, failed, or even returned early\n    }\n}\n",[1117,1379,1380,1385,1389,1393,1398,1403,1407,1412,1416,1421,1425,1430,1434,1440,1446,1452,1458],{"__ignoreMap":1141},[1145,1381,1382],{"class":1147,"line":1148},[1145,1383,1384],{},"Scanner scan = null;\n",[1145,1386,1387],{"class":1147,"line":1154},[1145,1388,1151],{},[1145,1390,1391],{"class":1147,"line":1160},[1145,1392,1157],{},[1145,1394,1395],{"class":1147,"line":1166},[1145,1396,1397],{},"    scan = new Scanner(new File(\"auto_config.csv\"));\n",[1145,1399,1400],{"class":1147,"line":1172},[1145,1401,1402],{},"    \u002F\u002F ... read the file ...\n",[1145,1404,1405],{"class":1147,"line":1178},[1145,1406,1169],{},[1145,1408,1409],{"class":1147,"line":1183},[1145,1410,1411],{},"catch (FileNotFoundException e)\n",[1145,1413,1414],{"class":1147,"line":1189},[1145,1415,1157],{},[1145,1417,1418],{"class":1147,"line":1195},[1145,1419,1420],{},"    reportWarning(\"Missing auto_config.csv — using default route\");\n",[1145,1422,1423],{"class":1147,"line":1201},[1145,1424,1169],{},[1145,1426,1427],{"class":1147,"line":1283},[1145,1428,1429],{},"finally\n",[1145,1431,1432],{"class":1147,"line":1289},[1145,1433,1157],{},[1145,1435,1437],{"class":1147,"line":1436},13,[1145,1438,1439],{},"    if (scan != null)\n",[1145,1441,1443],{"class":1147,"line":1442},14,[1145,1444,1445],{},"    {\n",[1145,1447,1449],{"class":1147,"line":1448},15,[1145,1450,1451],{},"        scan.close(); \u002F\u002F runs whether the try succeeded, failed, or even returned early\n",[1145,1453,1455],{"class":1147,"line":1454},16,[1145,1456,1457],{},"    }\n",[1145,1459,1461],{"class":1147,"line":1460},17,[1145,1462,1169],{},[1080,1464,1465],{"id":1465},"try-with-resources",[1085,1467,1468,1469,1471,1472,1474,1475,1478,1479,1482,1483,1485,1486,1489,1490,1492],{},"The ",[1117,1470,1362],{},"-based cleanup above is exactly the case ",[1089,1473,1465],{}," exists to replace. Any resource that implements ",[1117,1476,1477],{},"AutoCloseable"," (like ",[1117,1480,1481],{},"Scanner",") can be declared inside parentheses right after ",[1117,1484,1130],{},"; Java then calls its ",[1117,1487,1488],{},"close()"," automatically, in every case, without a ",[1117,1491,1362],{}," block at all:",[1136,1494,1496],{"className":1138,"code":1495,"language":1140,"meta":1141,"style":1141},"try (Scanner scan = new Scanner(new File(\"auto_config.csv\")))\n{\n    \u002F\u002F ... read the file ...\n}\ncatch (FileNotFoundException e)\n{\n    reportWarning(\"Missing auto_config.csv — using default route\");\n}\n",[1117,1497,1498,1503,1507,1511,1515,1519,1523,1527],{"__ignoreMap":1141},[1145,1499,1500],{"class":1147,"line":1148},[1145,1501,1502],{},"try (Scanner scan = new Scanner(new File(\"auto_config.csv\")))\n",[1145,1504,1505],{"class":1147,"line":1154},[1145,1506,1157],{},[1145,1508,1509],{"class":1147,"line":1160},[1145,1510,1402],{},[1145,1512,1513],{"class":1147,"line":1166},[1145,1514,1169],{},[1145,1516,1517],{"class":1147,"line":1172},[1145,1518,1411],{},[1145,1520,1521],{"class":1147,"line":1178},[1145,1522,1157],{},[1145,1524,1525],{"class":1147,"line":1183},[1145,1526,1420],{},[1145,1528,1529],{"class":1147,"line":1189},[1145,1530,1169],{},[1085,1532,1533,1536,1537,1539,1540,1542,1543,1545],{},[1117,1534,1535],{},"scan"," is closed the moment the ",[1117,1538,1130],{}," block ends — normally or via an exception — and it only exists inside that ",[1117,1541,1130],{},". Prefer this form over a manual ",[1117,1544,1362],{}," whenever the resource type supports it.",[1080,1547,1549],{"id":1548},"checked-vs-unchecked-exceptions","Checked vs. Unchecked Exceptions",[1085,1551,1552],{},"Java splits exceptions into two kinds, and the difference matters for what the compiler demands of you:",[1554,1555,1556,1572],"ul",{},[1557,1558,1559,1478,1562,1564,1565,1567,1568,1571],"li",{},[1089,1560,1561],{},"Checked exceptions",[1117,1563,1213],{},") — the compiler forces you to either ",[1117,1566,1114],{}," them or declare them with a ",[1117,1569,1570],{},"throws"," clause. They represent problems a caller could reasonably be expected to recover from.",[1557,1573,1574,1577,1578,1580,1581,1584,1585,1580,1588,1580,1591,1594,1595,1597,1598,1600],{},[1089,1575,1576],{},"Unchecked exceptions"," (",[1117,1579,1305],{},", ",[1117,1582,1583],{},"Error",", and their subclasses — ",[1117,1586,1587],{},"NullPointerException",[1117,1589,1590],{},"ArrayIndexOutOfBoundsException",[1117,1592,1593],{},"ArithmeticException",") — the compiler does not require handling them at all, though you're always allowed to. ",[1117,1596,1305],{}," subclasses almost always represent a genuine programming bug (a null you forgot to check, an index you miscalculated) rather than something the caller can meaningfully recover from at runtime; ",[1117,1599,1583],{}," and its subclasses represent serious JVM-level failures ordinary code doesn't catch or throw.",[1085,1602,1603,1604,1607,1608,1610,1611,1613],{},"Guideline from the language's own designers: ",[1299,1605,1606],{},"if a client can reasonably be expected to recover from a problem, make it checked; if a client can't do anything useful about it, make it unchecked."," CSA covers unchecked-exception concepts (NullPointerException, ArrayIndexOutOfBoundsException) as topics in their own right, without teaching the ",[1117,1609,1130],{},"\u002F",[1117,1612,1114],{}," mechanism itself — the AP exam doesn't test it.",[1080,1615,1468,1617,1619],{"id":1616},"the-throws-clause",[1117,1618,1570],{}," Clause",[1085,1621,1622,1623,1610,1626,1629,1630,1632],{},"If a method doesn't want to handle a checked exception itself, it can instead declare that it might throw one, pushing the decision up to whoever calls it. ",[1117,1624,1625],{},"PrintWriter",[1117,1627,1628],{},"FileWriter"," write text to a file — the counterpart to ",[1117,1631,1481],{},", which Lesson 9.8 uses to read one:",[1136,1634,1636],{"className":1138,"code":1635,"language":1140,"meta":1141,"style":1141},"public void writeList() throws IOException\n{\n    try (PrintWriter out = new PrintWriter(new FileWriter(\"OutFile.txt\")))\n    {\n        \u002F\u002F ...\n    }\n}\n",[1117,1637,1638,1643,1647,1652,1656,1661,1665],{"__ignoreMap":1141},[1145,1639,1640],{"class":1147,"line":1148},[1145,1641,1642],{},"public void writeList() throws IOException\n",[1145,1644,1645],{"class":1147,"line":1154},[1145,1646,1157],{},[1145,1648,1649],{"class":1147,"line":1160},[1145,1650,1651],{},"    try (PrintWriter out = new PrintWriter(new FileWriter(\"OutFile.txt\")))\n",[1145,1653,1654],{"class":1147,"line":1166},[1145,1655,1445],{},[1145,1657,1658],{"class":1147,"line":1172},[1145,1659,1660],{},"        \u002F\u002F ...\n",[1145,1662,1663],{"class":1147,"line":1178},[1145,1664,1457],{},[1145,1666,1667],{"class":1147,"line":1183},[1145,1668,1169],{},[1085,1670,1671,1673,1674,1676,1677,1679,1680,1683,1684,1687],{},[1117,1672,1570],{}," goes after the parameter list, before the method body's opening brace. Unchecked exceptions never need to appear in a ",[1117,1675,1570],{}," clause (though nothing stops you from listing one). Note the ",[1117,1678,1130],{},"-with-resources here too: without it, an exception thrown between opening ",[1117,1681,1682],{},"out"," and calling ",[1117,1685,1686],{},"out.close()"," would skip the close and leak the file handle.",[1080,1689,1468,1691,1694],{"id":1690},"the-throw-statement",[1117,1692,1693],{},"throw"," Statement",[1085,1696,1697,1698,1700,1701,1704],{},"Any code — yours, a library's, or the Java runtime itself — can trigger an exception with the ",[1117,1699,1693],{}," statement, given any object that's a ",[1117,1702,1703],{},"Throwable"," (or a subclass):",[1136,1706,1708],{"className":1138,"code":1707,"language":1140,"meta":1141,"style":1141},"public void setTargetAngle(double degrees)\n{\n    if (degrees \u003C 0 || degrees > 180)\n    {\n        throw new IllegalArgumentException(\"Angle out of range: \" + degrees);\n    }\n    this.targetAngle = degrees;\n}\n",[1117,1709,1710,1715,1719,1724,1728,1733,1737,1742],{"__ignoreMap":1141},[1145,1711,1712],{"class":1147,"line":1148},[1145,1713,1714],{},"public void setTargetAngle(double degrees)\n",[1145,1716,1717],{"class":1147,"line":1154},[1145,1718,1157],{},[1145,1720,1721],{"class":1147,"line":1160},[1145,1722,1723],{},"    if (degrees \u003C 0 || degrees > 180)\n",[1145,1725,1726],{"class":1147,"line":1166},[1145,1727,1445],{},[1145,1729,1730],{"class":1147,"line":1172},[1145,1731,1732],{},"        throw new IllegalArgumentException(\"Angle out of range: \" + degrees);\n",[1145,1734,1735],{"class":1147,"line":1178},[1145,1736,1457],{},[1145,1738,1739],{"class":1147,"line":1183},[1145,1740,1741],{},"    this.targetAngle = degrees;\n",[1145,1743,1744],{"class":1147,"line":1189},[1145,1745,1169],{},[1085,1747,1748,1749,1751,1752,1755,1756,1758,1759,1761,1762,1764,1765,1767],{},"Every exception type in Java descends from ",[1117,1750,1703],{}," — each one is a ",[1089,1753,1754],{},"subclass"," of it (built on top of it, inheriting its behavior; Ch.17 covers what that means in full). Its two direct children are ",[1117,1757,1583],{}," (serious JVM-level failures — not something ordinary code catches or throws) and ",[1117,1760,1351],{}," (everything an ordinary program throws and catches), and ",[1117,1763,1305],{}," is the branch of ",[1117,1766,1351],{}," reserved for unchecked exceptions.",[1080,1769,1771],{"id":1770},"reading-what-went-wrong","Reading What Went Wrong",[1085,1773,1774],{},"Every exception carries a message, and a caught one doesn't have to be handled blind:",[1136,1776,1778],{"className":1138,"code":1777,"language":1140,"meta":1141,"style":1141},"catch (IllegalArgumentException e)\n{\n    reportWarning(\"Rejected: \" + e.getMessage()); \u002F\u002F \"Angle out of range: 240.0\"\n}\n",[1117,1779,1780,1785,1789,1794],{"__ignoreMap":1141},[1145,1781,1782],{"class":1147,"line":1148},[1145,1783,1784],{},"catch (IllegalArgumentException e)\n",[1145,1786,1787],{"class":1147,"line":1154},[1145,1788,1157],{},[1145,1790,1791],{"class":1147,"line":1160},[1145,1792,1793],{},"    reportWarning(\"Rejected: \" + e.getMessage()); \u002F\u002F \"Angle out of range: 240.0\"\n",[1145,1795,1796],{"class":1147,"line":1166},[1145,1797,1169],{},[1085,1799,1800,1803,1804,1807,1808,1811,1812,1815],{},[1117,1801,1802],{},"e.getMessage()"," returns the text passed to the exception's constructor (",[1117,1805,1806],{},"\"Angle out of range: \" + degrees"," above) — use it in a log message instead of guessing what failed. An ",[1299,1809,1810],{},"uncaught"," exception prints a ",[1089,1813,1814],{},"stack trace",": the exception type and message, followed by the chain of method calls (most recent first) that led to it —",[1136,1817,1822],{"className":1818,"code":1820,"language":1821},[1819],"language-text","java.lang.IllegalArgumentException: Angle out of range: 240.0\n    at Arm.setTargetAngle(Arm.java:107)\n    at Robot.teleopPeriodic(Robot.java:42)\n","text",[1117,1823,1820],{"__ignoreMap":1141},[1085,1825,1826,1827,1830],{},"— which is exactly what shows up when robot code crashes: read from the top down, the first line is the problem, and the first ",[1117,1828,1829],{},"at"," line naming your own class (not a library's) is usually where to start looking.",[1085,1832,1833,1834,1837,1838,1841],{},"Writing your ",[1089,1835,1836],{},"own"," exception types (for errors specific to your robot code, not covered by a built-in class) needs ",[1117,1839,1840],{},"extends",", which isn't taught until Ch.17 — Lesson 17.2 covers it.",[1080,1843,1845],{"id":1844},"common-pitfalls","Common Pitfalls",[1554,1847,1848,1861,1875],{},[1557,1849,1850,1853,1854,1856,1857,1860],{},[1089,1851,1852],{},"Catch-and-ignore."," An empty ",[1117,1855,1114],{}," block silently swallows a real problem — at minimum, log or report it (",[1117,1858,1859],{},"reportWarning(...)"," above), even if there's nothing more to do.",[1557,1862,1863,1866,1867,1610,1869,1871,1872,1874],{},[1089,1864,1865],{},"Catching to \"fix\" a bug instead of fixing it."," Wrapping buggy code in ",[1117,1868,1130],{},[1117,1870,1114],{}," to suppress a ",[1117,1873,1587],{}," hides the actual mistake instead of correcting it — reserve catching for genuinely recoverable situations (a missing file, an unreachable camera), not programming errors.",[1557,1876,1877,1892,1893,1895],{},[1089,1878,1879,1880,1882,1883,1886,1887,1610,1889,1891],{},"Forgetting ",[1117,1881,1362],{}," runs even on an early ",[1117,1884,1885],{},"return"," inside ",[1117,1888,1130],{},[1117,1890,1114],{},"."," Cleanup code that must always run belongs in ",[1117,1894,1362],{},", not duplicated at the end of every branch.",[1080,1897,1899],{"id":1898},"key-takeaways","Key Takeaways",[1554,1901,1902,1905,1921,1935,1943,1948],{},[1557,1903,1904],{},"Throwing an exception creates an object describing the problem and hands it to the runtime, which searches the call stack for a matching handler; an unhandled exception crashes the program (a red \"Robot Code\" indicator, on a robot).",[1557,1906,1907,1909,1910,1912,1913,1915,1916,1918,1919,1891],{},[1117,1908,1130],{}," wraps risky code; one or more ",[1117,1911,1114],{}," blocks (in order, general after specific, or combined with ",[1117,1914,1315],{},") handle specific exception types; an optional ",[1117,1917,1362],{}," block always runs, for cleanup — or use try-with-resources for anything ",[1117,1920,1477],{},[1557,1922,1923,1924,1926,1927,1929,1930,1580,1932,1934],{},"Checked exceptions (like ",[1117,1925,1213],{},") must be caught or declared with ",[1117,1928,1570],{},"; unchecked exceptions (",[1117,1931,1305],{},[1117,1933,1583],{},", and their subclasses) don't require either, since they usually signal a real bug rather than a recoverable situation.",[1557,1936,1937,1940,1941,1891],{},[1117,1938,1939],{},"throw someObject;"," triggers an exception yourself, given any ",[1117,1942,1703],{},[1557,1944,1945,1947],{},[1117,1946,1802],{}," reports what went wrong; an uncaught exception prints a stack trace, read top-down.",[1557,1949,1950],{},"Never catch-and-ignore — recover meaningfully, or at least report the problem.",[1085,1952,1953,1954,1957,1958,1580,1961,1580,1964,1580,1967,1580,1970,1973,1974,1977],{},"Derived from ",[1117,1955,1956],{},"other-reference-repo",": ",[1117,1959,1960],{},"oracle-java-tutorials\u002Fexceptions\u002F01-what-is-an-exception.md",[1117,1962,1963],{},"03-catching-and-handling-exceptions.md",[1117,1965,1966],{},"09-specifying-the-exceptions-thrown-by-a-method.md",[1117,1968,1969],{},"10-how-to-throw-exceptions.md",[1117,1971,1972],{},"13-unchecked-exceptions-the-controversy.md"," (ORACLE 11.1-16)\n",[1089,1975,1976],{},"Deck context:"," mechacoder-test\u002Fsrc\u002Flessons\u002Fjava-1.js, slide 11 (\"Exceptions & try\u002Fcatch\")",[1979,1980,1981],"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":1141,"searchDepth":1154,"depth":1154,"links":1983},[1984,1985,1986,1987,1988,1989,1991,1993,1994,1995],{"id":1082,"depth":1154,"text":1083},{"id":1123,"depth":1154,"text":1124},{"id":1362,"depth":1154,"text":1362},{"id":1465,"depth":1154,"text":1465},{"id":1548,"depth":1154,"text":1549},{"id":1616,"depth":1154,"text":1990},"The throws Clause",{"id":1690,"depth":1154,"text":1992},"The throw Statement",{"id":1770,"depth":1154,"text":1771},{"id":1844,"depth":1154,"text":1845},{"id":1898,"depth":1154,"text":1899},"md",{"outlineRef":1998,"status":1999},"12 — Exceptions & try\u002Fcatch (ORACLE 11.1-16)","new — authored lesson (fuller depth than the teaser slide)",true,{"title":190,"description":1141},"ut608Pyuwq3-Z3fmE7cQd3rBsZJLsucLzq1FqP9wjLI",{"id":2004,"title":627,"body":2005,"description":1141,"extension":1996,"meta":2597,"navigation":2000,"path":626,"seo":2600,"stem":628,"__hash__":2601},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch.md",{"type":1073,"value":2006,"toc":2587},[2007,2010,2014,2025,2029,2059,2063,2104,2126,2130,2220,2223,2229,2243,2247,2258,2320,2322,2328,2346,2350,2361,2500,2506,2512,2516,2523,2529,2541,2545,2585],[1076,2008,627],{"id":2009},"exceptions-trycatch-worked-example",[1080,2011,2013],{"id":2012},"problem","Problem",[1085,2015,2016,2017,2020,2021,2024],{},"The pit crew can type a climber speed into the dashboard before a match. Motor speeds only make sense between ",[1117,2018,2019],{},"-1.0"," and ",[1117,2022,2023],{},"1.0",", so a method that sets the climber speed should refuse anything outside that range. The code that reads the dashboard value should recover when the number is bad instead of crashing, and it should always log that the request was handled, whether or not the speed was accepted.",[1080,2026,2028],{"id":2027},"step-1-plan-it-first","Step 1: Plan It First",[2030,2031,2032,2042,2045,2053],"ol",{},[1557,2033,2034,2035,2038,2039,2041],{},"Write ",[1117,2036,2037],{},"setClimberSpeed",", which ",[1089,2040,1570],{}," an exception when the speed is out of range.",[1557,2043,2044],{},"Call it with a bad value and see what happens when nothing catches the exception.",[1557,2046,2047,2048,1610,2050,2052],{},"Wrap the call in ",[1117,2049,1130],{},[1117,2051,1114],{}," so a bad value is rejected cleanly.",[1557,2054,2055,2056,2058],{},"Add a ",[1117,2057,1362],{}," block for the \"request handled\" log line that must always print.",[1080,2060,2062],{"id":2061},"step-2-throw-when-the-speed-is-out-of-range","Step 2: Throw When the Speed Is Out of Range",[1136,2064,2066],{"className":1138,"code":2065,"language":1140,"meta":1141,"style":1141},"public static void setClimberSpeed(double speed)\n{\n    if (speed \u003C -1.0 || speed > 1.0)\n    {\n        throw new IllegalArgumentException(\"Climber speed out of range: \" + speed);\n    }\n    System.out.println(\"Climber running at \" + speed);\n}\n",[1117,2067,2068,2073,2077,2082,2086,2091,2095,2100],{"__ignoreMap":1141},[1145,2069,2070],{"class":1147,"line":1148},[1145,2071,2072],{},"public static void setClimberSpeed(double speed)\n",[1145,2074,2075],{"class":1147,"line":1154},[1145,2076,1157],{},[1145,2078,2079],{"class":1147,"line":1160},[1145,2080,2081],{},"    if (speed \u003C -1.0 || speed > 1.0)\n",[1145,2083,2084],{"class":1147,"line":1166},[1145,2085,1445],{},[1145,2087,2088],{"class":1147,"line":1172},[1145,2089,2090],{},"        throw new IllegalArgumentException(\"Climber speed out of range: \" + speed);\n",[1145,2092,2093],{"class":1147,"line":1178},[1145,2094,1457],{},[1145,2096,2097],{"class":1147,"line":1183},[1145,2098,2099],{},"    System.out.println(\"Climber running at \" + speed);\n",[1145,2101,2102],{"class":1147,"line":1189},[1145,2103,1169],{},[1085,2105,2106,2108,2109,2112,2113,2116,2117,2119,2120,2122,2123,2125],{},[1117,2107,1693],{}," creates an ",[1117,2110,2111],{},"IllegalArgumentException"," object that describes the problem and hands it to the Java runtime. The method stops right there, so the ",[1117,2114,2115],{},"println"," below it never runs for a bad speed. ",[1117,2118,2111],{}," is unchecked (a ",[1117,2121,1305],{},"), so the method doesn't need a ",[1117,2124,1570],{}," clause.",[1080,2127,2129],{"id":2128},"step-3-call-it-without-any-handler","Step 3: Call It Without Any Handler",[1136,2131,2133],{"className":1138,"code":2132,"language":1140,"meta":1141,"style":1141},"public class ClimberControl\n{\n    public static void setClimberSpeed(double speed)\n    {\n        if (speed \u003C -1.0 || speed > 1.0)\n        {\n            throw new IllegalArgumentException(\"Climber speed out of range: \" + speed);\n        }\n        System.out.println(\"Climber running at \" + speed);\n    }\n\n    public static void main(String[] args)\n    {\n        double requestedSpeed = 1.5; \u002F\u002F stand-in for a value typed into the dashboard\n        setClimberSpeed(requestedSpeed);\n        System.out.println(\"Climb command sent\");\n    }\n}\n",[1117,2134,2135,2140,2144,2149,2153,2158,2163,2168,2173,2178,2182,2187,2192,2196,2201,2206,2211,2215],{"__ignoreMap":1141},[1145,2136,2137],{"class":1147,"line":1148},[1145,2138,2139],{},"public class ClimberControl\n",[1145,2141,2142],{"class":1147,"line":1154},[1145,2143,1157],{},[1145,2145,2146],{"class":1147,"line":1160},[1145,2147,2148],{},"    public static void setClimberSpeed(double speed)\n",[1145,2150,2151],{"class":1147,"line":1166},[1145,2152,1445],{},[1145,2154,2155],{"class":1147,"line":1172},[1145,2156,2157],{},"        if (speed \u003C -1.0 || speed > 1.0)\n",[1145,2159,2160],{"class":1147,"line":1178},[1145,2161,2162],{},"        {\n",[1145,2164,2165],{"class":1147,"line":1183},[1145,2166,2167],{},"            throw new IllegalArgumentException(\"Climber speed out of range: \" + speed);\n",[1145,2169,2170],{"class":1147,"line":1189},[1145,2171,2172],{},"        }\n",[1145,2174,2175],{"class":1147,"line":1195},[1145,2176,2177],{},"        System.out.println(\"Climber running at \" + speed);\n",[1145,2179,2180],{"class":1147,"line":1201},[1145,2181,1457],{},[1145,2183,2184],{"class":1147,"line":1283},[1145,2185,2186],{"emptyLinePlaceholder":2000},"\n",[1145,2188,2189],{"class":1147,"line":1289},[1145,2190,2191],{},"    public static void main(String[] args)\n",[1145,2193,2194],{"class":1147,"line":1436},[1145,2195,1445],{},[1145,2197,2198],{"class":1147,"line":1442},[1145,2199,2200],{},"        double requestedSpeed = 1.5; \u002F\u002F stand-in for a value typed into the dashboard\n",[1145,2202,2203],{"class":1147,"line":1448},[1145,2204,2205],{},"        setClimberSpeed(requestedSpeed);\n",[1145,2207,2208],{"class":1147,"line":1454},[1145,2209,2210],{},"        System.out.println(\"Climb command sent\");\n",[1145,2212,2213],{"class":1147,"line":1460},[1145,2214,1457],{},[1145,2216,2218],{"class":1147,"line":2217},18,[1145,2219,1169],{},[1085,2221,2222],{},"Output:",[1136,2224,2227],{"className":2225,"code":2226,"language":1821},[1819],"Exception in thread \"main\" java.lang.IllegalArgumentException: Climber speed out of range: 1.5\n    at ClimberControl.setClimberSpeed(ClimberControl.java:7)\n    at ClimberControl.main(ClimberControl.java:15)\n",[1117,2228,2226],{"__ignoreMap":1141},[1085,2230,2231,2232,2234,2235,2238,2239,2242],{},"The runtime searched back up the call stack, first ",[1117,2233,2037],{}," and then ",[1117,2236,2237],{},"main",", and found no handler, so it ended the program. ",[1117,2240,2241],{},"\"Climb command sent\""," never printed. On a robot, this is the kind of crash that turns the \"Robot Code\" indicator red.",[1080,2244,2246],{"id":2245},"step-4-catch-it-and-recover","Step 4: Catch It and Recover",[1085,2248,2249,2250,2252,2253,1610,2255,2257],{},"A speed typed into the dashboard can be wrong, and the robot can recover from that by leaving the climber stopped. So ",[1117,2251,2237],{}," wraps the call in ",[1117,2254,1130],{},[1117,2256,1114],{},":",[1136,2259,2261],{"className":1138,"code":2260,"language":1140,"meta":1141,"style":1141},"public static void main(String[] args)\n{\n    double requestedSpeed = 1.5; \u002F\u002F stand-in for a value typed into the dashboard\n    try\n    {\n        setClimberSpeed(requestedSpeed);\n        System.out.println(\"Climb command sent\");\n    }\n    catch (IllegalArgumentException e)\n    {\n        System.out.println(\"Rejected dashboard speed - climber stays stopped\");\n    }\n}\n",[1117,2262,2263,2268,2272,2277,2282,2286,2290,2294,2298,2303,2307,2312,2316],{"__ignoreMap":1141},[1145,2264,2265],{"class":1147,"line":1148},[1145,2266,2267],{},"public static void main(String[] args)\n",[1145,2269,2270],{"class":1147,"line":1154},[1145,2271,1157],{},[1145,2273,2274],{"class":1147,"line":1160},[1145,2275,2276],{},"    double requestedSpeed = 1.5; \u002F\u002F stand-in for a value typed into the dashboard\n",[1145,2278,2279],{"class":1147,"line":1166},[1145,2280,2281],{},"    try\n",[1145,2283,2284],{"class":1147,"line":1172},[1145,2285,1445],{},[1145,2287,2288],{"class":1147,"line":1178},[1145,2289,2205],{},[1145,2291,2292],{"class":1147,"line":1183},[1145,2293,2210],{},[1145,2295,2296],{"class":1147,"line":1189},[1145,2297,1457],{},[1145,2299,2300],{"class":1147,"line":1195},[1145,2301,2302],{},"    catch (IllegalArgumentException e)\n",[1145,2304,2305],{"class":1147,"line":1201},[1145,2306,1445],{},[1145,2308,2309],{"class":1147,"line":1283},[1145,2310,2311],{},"        System.out.println(\"Rejected dashboard speed - climber stays stopped\");\n",[1145,2313,2314],{"class":1147,"line":1289},[1145,2315,1457],{},[1145,2317,2318],{"class":1147,"line":1436},[1145,2319,1169],{},[1085,2321,2222],{},[1136,2323,2326],{"className":2324,"code":2325,"language":1821},[1819],"Rejected dashboard speed - climber stays stopped\n",[1117,2327,2325],{"__ignoreMap":1141},[1085,2329,2330,2331,2333,2334,2336,2337,2339,2340,2342,2343,2345],{},"When ",[1117,2332,2037],{}," throws, execution jumps straight into the matching ",[1117,2335,1114],{}," block, and the rest of the ",[1117,2338,1130],{}," block (",[1117,2341,2241],{},") is skipped. The ",[1117,2344,1114],{}," block doesn't stay silent, either: it reports what happened, so the problem isn't swallowed.",[1080,2347,2349],{"id":2348},"step-5-always-log-that-the-request-was-handled","Step 5: Always Log That the Request Was Handled",[1085,2351,2352,2353,2355,2356,2358,2359,2257],{},"The \"request handled\" line has to print on both paths, accepted and rejected. Rather than writing it once at the end of ",[1117,2354,1130],{}," and again at the end of ",[1117,2357,1114],{},", it goes in ",[1117,2360,1362],{},[1136,2362,2364],{"className":1138,"code":2363,"language":1140,"meta":1141,"style":1141},"public class ClimberControl\n{\n    public static void setClimberSpeed(double speed)\n    {\n        if (speed \u003C -1.0 || speed > 1.0)\n        {\n            throw new IllegalArgumentException(\"Climber speed out of range: \" + speed);\n        }\n        System.out.println(\"Climber running at \" + speed);\n    }\n\n    public static void main(String[] args)\n    {\n        double requestedSpeed = 1.5; \u002F\u002F stand-in for a value typed into the dashboard\n        try\n        {\n            setClimberSpeed(requestedSpeed);\n            System.out.println(\"Climb command sent\");\n        }\n        catch (IllegalArgumentException e)\n        {\n            System.out.println(\"Rejected dashboard speed - climber stays stopped\");\n        }\n        finally\n        {\n            System.out.println(\"Climb request handled\");\n        }\n    }\n}\n",[1117,2365,2366,2370,2374,2378,2382,2386,2390,2394,2398,2402,2406,2410,2414,2418,2422,2427,2431,2436,2441,2446,2452,2457,2463,2468,2474,2479,2485,2490,2495],{"__ignoreMap":1141},[1145,2367,2368],{"class":1147,"line":1148},[1145,2369,2139],{},[1145,2371,2372],{"class":1147,"line":1154},[1145,2373,1157],{},[1145,2375,2376],{"class":1147,"line":1160},[1145,2377,2148],{},[1145,2379,2380],{"class":1147,"line":1166},[1145,2381,1445],{},[1145,2383,2384],{"class":1147,"line":1172},[1145,2385,2157],{},[1145,2387,2388],{"class":1147,"line":1178},[1145,2389,2162],{},[1145,2391,2392],{"class":1147,"line":1183},[1145,2393,2167],{},[1145,2395,2396],{"class":1147,"line":1189},[1145,2397,2172],{},[1145,2399,2400],{"class":1147,"line":1195},[1145,2401,2177],{},[1145,2403,2404],{"class":1147,"line":1201},[1145,2405,1457],{},[1145,2407,2408],{"class":1147,"line":1283},[1145,2409,2186],{"emptyLinePlaceholder":2000},[1145,2411,2412],{"class":1147,"line":1289},[1145,2413,2191],{},[1145,2415,2416],{"class":1147,"line":1436},[1145,2417,1445],{},[1145,2419,2420],{"class":1147,"line":1442},[1145,2421,2200],{},[1145,2423,2424],{"class":1147,"line":1448},[1145,2425,2426],{},"        try\n",[1145,2428,2429],{"class":1147,"line":1454},[1145,2430,2162],{},[1145,2432,2433],{"class":1147,"line":1460},[1145,2434,2435],{},"            setClimberSpeed(requestedSpeed);\n",[1145,2437,2438],{"class":1147,"line":2217},[1145,2439,2440],{},"            System.out.println(\"Climb command sent\");\n",[1145,2442,2444],{"class":1147,"line":2443},19,[1145,2445,2172],{},[1145,2447,2449],{"class":1147,"line":2448},20,[1145,2450,2451],{},"        catch (IllegalArgumentException e)\n",[1145,2453,2455],{"class":1147,"line":2454},21,[1145,2456,2162],{},[1145,2458,2460],{"class":1147,"line":2459},22,[1145,2461,2462],{},"            System.out.println(\"Rejected dashboard speed - climber stays stopped\");\n",[1145,2464,2466],{"class":1147,"line":2465},23,[1145,2467,2172],{},[1145,2469,2471],{"class":1147,"line":2470},24,[1145,2472,2473],{},"        finally\n",[1145,2475,2477],{"class":1147,"line":2476},25,[1145,2478,2162],{},[1145,2480,2482],{"class":1147,"line":2481},26,[1145,2483,2484],{},"            System.out.println(\"Climb request handled\");\n",[1145,2486,2488],{"class":1147,"line":2487},27,[1145,2489,2172],{},[1145,2491,2493],{"class":1147,"line":2492},28,[1145,2494,1457],{},[1145,2496,2498],{"class":1147,"line":2497},29,[1145,2499,1169],{},[1085,2501,2502,2503,2257],{},"Output with ",[1117,2504,2505],{},"requestedSpeed = 1.5",[1136,2507,2510],{"className":2508,"code":2509,"language":1821},[1819],"Rejected dashboard speed - climber stays stopped\nClimb request handled\n",[1117,2511,2509],{"__ignoreMap":1141},[1080,2513,2515],{"id":2514},"step-6-check-the-other-path","Step 6: Check the Other Path",[1085,2517,2518,2519,2522],{},"Changing the dashboard value to a legal speed, ",[1117,2520,2521],{},"requestedSpeed = 0.6",", and running again:",[1136,2524,2527],{"className":2525,"code":2526,"language":1821},[1819],"Climber running at 0.6\nClimb command sent\nClimb request handled\n",[1117,2528,2526],{"__ignoreMap":1141},[1085,2530,2531,2532,2534,2535,2537,2538,2540],{},"Nothing is thrown, so the whole ",[1117,2533,1130],{}," block runs and the ",[1117,2536,1114],{}," block is skipped entirely. ",[1117,2539,1362],{}," still runs, which is the whole point of putting the log line there.",[1080,2542,2544],{"id":2543},"recap","Recap",[1554,2546,2547,2553,2556,2564,2569],{},[1557,2548,2549,2552],{},[1117,2550,2551],{},"throw new SomeException(...)"," stops the method and hands an exception object to the runtime.",[1557,2554,2555],{},"If nothing up the call stack catches it, the program ends, and any code after the throw never runs.",[1557,2557,1127,2558,2560,2561,2563],{},[1117,2559,1114],{}," block for the matching type lets the caller recover. The rest of the ",[1117,2562,1130],{}," block is skipped when an exception jumps to it.",[1557,2565,2566,2568],{},[1117,2567,1362],{}," runs whether or not an exception happened, so code that must always run belongs there.",[1557,2570,2571,2573,2574,2576,2577,1610,2579,2581,2582,2584],{},[1117,2572,2111],{}," is unchecked, so neither a ",[1117,2575,1570],{}," clause nor a ",[1117,2578,1130],{},[1117,2580,1114],{}," is required by the compiler. The ",[1117,2583,1114],{}," here is a choice, made because a bad dashboard value is a situation the robot can reasonably recover from.",[1979,2586,1981],{},{"title":1141,"searchDepth":1154,"depth":1154,"links":2588},[2589,2590,2591,2592,2593,2594,2595,2596],{"id":2012,"depth":1154,"text":2013},{"id":2027,"depth":1154,"text":2028},{"id":2061,"depth":1154,"text":2062},{"id":2128,"depth":1154,"text":2129},{"id":2245,"depth":1154,"text":2246},{"id":2348,"depth":1154,"text":2349},{"id":2514,"depth":1154,"text":2515},{"id":2543,"depth":1154,"text":2544},{"outlineRef":1998,"pairsWith":2598,"status":2599},"[`lessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch.md`](..\u002F..\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt)",{"title":627,"description":1141},"LU_Rp_8U35V1M_iYsY8LJqfJwWv8aP-MHweS29f9OoM",{"id":2603,"title":936,"body":2604,"description":1141,"extension":1996,"meta":3579,"navigation":2000,"path":935,"seo":3581,"stem":937,"__hash__":3582},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch.md",{"type":1073,"value":2605,"toc":3574},[2606,2609,2613,2623,2656,2661,2700,2706,2730,2759,2763,2779,2828,2831,2891,2896,2902,2988,2997,3099,3103,3109,3122,3143,3175,3178,3204,3212,3217,3275,3280,3399,3404,3523,3572],[1076,2607,936],{"id":2608},"exceptions-trycatch-exercises",[1080,2610,2612],{"id":2611},"multiple-choice","Multiple Choice",[1085,2614,2615,2618,2619,2622],{},[1089,2616,2617],{},"Question:"," A teammate writes this method to save a short match summary to a file. The class it lives in already has ",[1117,2620,2621],{},"import java.io.*;"," at the top. It doesn't compile. Why?",[1136,2624,2626],{"className":1138,"code":2625,"language":1140,"meta":1141,"style":1141},"public static void saveMatchLog()\n{\n    PrintWriter out = new PrintWriter(new FileWriter(\"match_log.txt\"));\n    out.println(\"Match 12: 3 notes scored, climbed\");\n    out.close();\n}\n",[1117,2627,2628,2633,2637,2642,2647,2652],{"__ignoreMap":1141},[1145,2629,2630],{"class":1147,"line":1148},[1145,2631,2632],{},"public static void saveMatchLog()\n",[1145,2634,2635],{"class":1147,"line":1154},[1145,2636,1157],{},[1145,2638,2639],{"class":1147,"line":1160},[1145,2640,2641],{},"    PrintWriter out = new PrintWriter(new FileWriter(\"match_log.txt\"));\n",[1145,2643,2644],{"class":1147,"line":1166},[1145,2645,2646],{},"    out.println(\"Match 12: 3 notes scored, climbed\");\n",[1145,2648,2649],{"class":1147,"line":1172},[1145,2650,2651],{},"    out.close();\n",[1145,2653,2654],{"class":1147,"line":1178},[1145,2655,1169],{},[1085,2657,2658],{},[1089,2659,2660],{},"Options:",[1554,2662,2663,2676,2679,2688],{},[1557,2664,2665,2666,2669,2670,2672,2673],{},"A. ",[1117,2667,2668],{},"new FileWriter(...)"," can throw an ",[1117,2671,1213],{},", which is a checked exception, so the method has to either catch it or declare ",[1117,2674,2675],{},"throws IOException",[1557,2677,2678],{},"B. It compiles fine. It only fails at run time, and only if the file can't be created",[1557,2680,2681,2682,2684,2685,2687],{},"C. ",[1117,2683,1686],{}," has to be inside a ",[1117,2686,1362],{}," block, or the compiler rejects the method",[1557,2689,2690,2691,2694,2695,1297,2697],{},"D. The method has to declare ",[1117,2692,2693],{},"throws NullPointerException",", in case ",[1117,2696,1682],{},[1117,2698,2699],{},"null",[1085,2701,2702,2705],{},[1089,2703,2704],{},"Answer:"," A",[1085,2707,2708,2711,2712,2714,2715,1610,2717,2719,2720,2722,2723,2725,2726,2729],{},[1089,2709,2710],{},"Why:"," ",[1117,2713,1213],{}," is a checked exception. The compiler requires every piece of code that can throw one to either handle it with ",[1117,2716,1130],{},[1117,2718,1114],{}," or pass it up to the caller with a ",[1117,2721,1570],{}," clause. This method does neither, so the compiler stops with an error. Adding ",[1117,2724,2675],{}," after ",[1117,2727,2728],{},"saveMatchLog()"," fixes it.",[1554,2731,2732,2735,2747],{},[1557,2733,2734],{},"B is wrong. The whole point of a checked exception is that the compiler checks for it before the program ever runs. The code never gets far enough to try creating the file.",[1557,2736,2737,2738,2740,2741,2743,2744,2746],{},"C is wrong. ",[1117,2739,1362],{}," is a good place for cleanup like ",[1117,2742,1488],{},", but the compiler never requires it. The missing handler for ",[1117,2745,1213],{}," is the only problem here.",[1557,2748,2749,2750,2752,2753,2755,2756,2758],{},"D is wrong. ",[1117,2751,1587],{}," is unchecked, so it never needs a ",[1117,2754,1570],{}," clause. Declaring it also wouldn't fix anything, because the ",[1117,2757,1213],{}," would still be unhandled.",[1080,2760,2762],{"id":2761},"micro-parsons","Micro-Parsons",[1085,2764,2765,2768,2769,2771,2772,2774,2775,2778],{},[1089,2766,2767],{},"Problem:"," Given this program's imports, class, and ",[1117,2770,2237],{}," method, reorder the fragments below into the body of ",[1117,2773,2237],{},". The body tries to open ",[1117,2776,2777],{},"pit_notes.txt"," and print its first line. If the file doesn't exist, it prints a fallback message instead of crashing.",[1136,2780,2782],{"className":1138,"code":2781,"language":1140,"meta":1141,"style":1141},"import java.io.*;\nimport java.util.*;\n\npublic class PitNotes\n{\n    public static void main(String[] args)\n    {\n        \u002F\u002F ⟵ reorder the fragments below into this body\n    }\n}\n",[1117,2783,2784,2789,2794,2798,2803,2807,2811,2815,2820,2824],{"__ignoreMap":1141},[1145,2785,2786],{"class":1147,"line":1148},[1145,2787,2788],{},"import java.io.*;\n",[1145,2790,2791],{"class":1147,"line":1154},[1145,2792,2793],{},"import java.util.*;\n",[1145,2795,2796],{"class":1147,"line":1160},[1145,2797,2186],{"emptyLinePlaceholder":2000},[1145,2799,2800],{"class":1147,"line":1166},[1145,2801,2802],{},"public class PitNotes\n",[1145,2804,2805],{"class":1147,"line":1172},[1145,2806,1157],{},[1145,2808,2809],{"class":1147,"line":1178},[1145,2810,2191],{},[1145,2812,2813],{"class":1147,"line":1183},[1145,2814,1445],{},[1145,2816,2817],{"class":1147,"line":1189},[1145,2818,2819],{},"        \u002F\u002F ⟵ reorder the fragments below into this body\n",[1145,2821,2822],{"class":1147,"line":1195},[1145,2823,1457],{},[1145,2825,2826],{"class":1147,"line":1201},[1145,2827,1169],{},[1085,2829,2830],{},"Reorder the fragments below to complete it:",[1554,2832,2833,2839,2845,2851,2857,2863,2869,2875,2880,2886],{},[1557,2834,2835,2836],{},"a. ",[1117,2837,2838],{},"            System.out.println(scan.nextLine());",[1557,2840,2841,2842],{},"b. ",[1117,2843,2844],{},"        catch (FileNotFoundException e)",[1557,2846,2847,2848],{},"c. ",[1117,2849,2850],{},"        {",[1557,2852,2853,2854],{},"d. ",[1117,2855,2856],{},"        }",[1557,2858,2859,2860],{},"e. ",[1117,2861,2862],{},"            Scanner scan = new Scanner(new File(\"pit_notes.txt\"));",[1557,2864,2865,2866],{},"f. ",[1117,2867,2868],{},"            System.out.println(\"No pit notes found - starting fresh\");",[1557,2870,2871,2872],{},"g. ",[1117,2873,2874],{},"        try",[1557,2876,2877,2878],{},"h. ",[1117,2879,2856],{},[1557,2881,2882,2883],{},"i. ",[1117,2884,2885],{},"            scan.close();",[1557,2887,2888,2889],{},"j. ",[1117,2890,2850],{},[1085,2892,2893,2895],{},[1089,2894,2704],{}," g, c, e, a, i, h, b, j, f, d",[1085,2897,2898,2901],{},[1089,2899,2900],{},"Interchangeable:"," (c, j) (d, h)",[1136,2903,2905],{"className":1138,"code":2904,"language":1140,"meta":1141,"style":1141},"import java.io.*;\nimport java.util.*;\n\npublic class PitNotes\n{\n    public static void main(String[] args)\n    {\n        try\n        {\n            Scanner scan = new Scanner(new File(\"pit_notes.txt\"));\n            System.out.println(scan.nextLine());\n            scan.close();\n        }\n        catch (FileNotFoundException e)\n        {\n            System.out.println(\"No pit notes found - starting fresh\");\n        }\n    }\n}\n",[1117,2906,2907,2911,2915,2919,2923,2927,2931,2935,2939,2943,2948,2953,2958,2962,2967,2971,2976,2980,2984],{"__ignoreMap":1141},[1145,2908,2909],{"class":1147,"line":1148},[1145,2910,2788],{},[1145,2912,2913],{"class":1147,"line":1154},[1145,2914,2793],{},[1145,2916,2917],{"class":1147,"line":1160},[1145,2918,2186],{"emptyLinePlaceholder":2000},[1145,2920,2921],{"class":1147,"line":1166},[1145,2922,2802],{},[1145,2924,2925],{"class":1147,"line":1172},[1145,2926,1157],{},[1145,2928,2929],{"class":1147,"line":1178},[1145,2930,2191],{},[1145,2932,2933],{"class":1147,"line":1183},[1145,2934,1445],{},[1145,2936,2937],{"class":1147,"line":1189},[1145,2938,2426],{},[1145,2940,2941],{"class":1147,"line":1195},[1145,2942,2162],{},[1145,2944,2945],{"class":1147,"line":1201},[1145,2946,2947],{},"            Scanner scan = new Scanner(new File(\"pit_notes.txt\"));\n",[1145,2949,2950],{"class":1147,"line":1283},[1145,2951,2952],{},"            System.out.println(scan.nextLine());\n",[1145,2954,2955],{"class":1147,"line":1289},[1145,2956,2957],{},"            scan.close();\n",[1145,2959,2960],{"class":1147,"line":1436},[1145,2961,2172],{},[1145,2963,2964],{"class":1147,"line":1442},[1145,2965,2966],{},"        catch (FileNotFoundException e)\n",[1145,2968,2969],{"class":1147,"line":1448},[1145,2970,2162],{},[1145,2972,2973],{"class":1147,"line":1454},[1145,2974,2975],{},"            System.out.println(\"No pit notes found - starting fresh\");\n",[1145,2977,2978],{"class":1147,"line":1460},[1145,2979,2172],{},[1145,2981,2982],{"class":1147,"line":2217},[1145,2983,1457],{},[1145,2985,2986],{"class":1147,"line":2443},[1145,2987,1169],{},[1085,2989,1206,2990,2992,2993,2996],{},[1117,2991,2777],{}," is missing, the output is ",[1117,2994,2995],{},"No pit notes found - starting fresh",". If it exists, the output is its first line.",[1085,2998,2999,2711,3002,1577,3004,3007,3008,3011,3012,3014,3015,3017,3018,3021,3022,3025,3026,3029,3030,3032,3033,3035,3036,3039,3040,3042,3043,3045,3046,3049,3050,1577,3052,3055,3056,1580,3059,1580,3062,3065,3066,2339,3068,1580,3070,3072,3073,3075,3076,2020,3078,3080,3081,3084,3085,2020,3087,3080,3089,3092,3093,3095,3096,3098],{},[1089,3000,3001],{},"Why this order:",[1117,3003,1130],{},[1117,3005,3006],{},"g",") and its opening brace (",[1117,3009,3010],{},"c",") come first, because the code that might throw has to be inside the ",[1117,3013,1130],{}," block. Inside it, the ",[1117,3016,1481],{}," has to be created (",[1117,3019,3020],{},"e",") before anything can be read from it (",[1117,3023,3024],{},"a","), and it can only be closed (",[1117,3027,3028],{},"i",") after the reading is done. Line ",[1117,3031,3020],{},", the ",[1117,3034,1481],{}," constructor, is the one that can throw ",[1117,3037,3038],{},"FileNotFoundException",", which is why it sits inside ",[1117,3041,1130],{},". The ",[1117,3044,1130],{}," block closes (",[1117,3047,3048],{},"h","), and the ",[1117,3051,1114],{},[1117,3053,3054],{},"b",") follows it directly. Its body (",[1117,3057,3058],{},"j",[1117,3060,3061],{},"f",[1117,3063,3064],{},"d",") holds the fallback message, which only runs if opening the file failed. If opening the file fails, the rest of the ",[1117,3067,1130],{},[1117,3069,3024],{},[1117,3071,3028],{},") is skipped and execution jumps straight to ",[1117,3074,3061],{},". Note that ",[1117,3077,3010],{},[1117,3079,3058],{}," (both an eight-space ",[1117,3082,3083],{},"{",") are identical, and so are ",[1117,3086,3048],{},[1117,3088,3064],{},[1117,3090,3091],{},"}","). One of each pair belongs to ",[1117,3094,1130],{}," and the other to ",[1117,3097,1114],{},", so it doesn't matter which copy goes where, as long as each block gets one opening and one closing brace.",[1080,3100,3102],{"id":3101},"coding","Coding",[1085,3104,3105,3108],{},[1089,3106,3107],{},"Mode:"," harness",[1085,3110,3111,3113,3114,3117,3118,3121],{},[1089,3112,2767],{}," A turret only accepts target angles from ",[1117,3115,3116],{},"0.0"," to ",[1117,3119,3120],{},"180.0"," degrees, inclusive. Write two\nmethods.",[1085,3123,3124,1210,3127,3129,3130,3132,3133,3136,3137,3139,3140,3142],{},[1117,3125,3126],{},"checkAngle",[1117,3128,2111],{}," whose message is exactly\n",[1117,3131,1806],{}," when ",[1117,3134,3135],{},"degrees"," is below ",[1117,3138,3116],{}," or above ",[1117,3141,3120],{},", and does nothing\notherwise.",[1085,3144,3145,3148,3149,3151,3152,3155,3156,3159,3160,3162,3163,1610,3165,3167,3168,3171,3172,1891],{},[1117,3146,3147],{},"firstRejection"," takes an array of requested angles and calls ",[1117,3150,3126],{}," on each one, in order.\nIt returns the ",[1089,3153,3154],{},"message"," of the ",[1089,3157,3158],{},"first"," exception that ",[1117,3161,3126],{}," throws (use ",[1117,3164,1130],{},[1117,3166,1114],{},"\nand ",[1117,3169,3170],{},"getMessage()","). If no request is rejected, it returns ",[1117,3173,3174],{},"\"all accepted\"",[1085,3176,3177],{},"Examples:",[1554,3179,3180,3189,3196],{},[1557,3181,3182,3185,3186],{},[1117,3183,3184],{},"firstRejection(new double[] {10.0, 240.0, 90.0})"," returns ",[1117,3187,3188],{},"\"Angle out of range: 240.0\"",[1557,3190,3191,3185,3194],{},[1117,3192,3193],{},"firstRejection(new double[] {0.0, 180.0})",[1117,3195,3174],{},[1557,3197,3198,3185,3201],{},[1117,3199,3200],{},"firstRejection(new double[] {-5.0})",[1117,3202,3203],{},"\"Angle out of range: -5.0\"",[1085,3205,3206,2711,3209],{},[1089,3207,3208],{},"Signature:",[1117,3210,3211],{},"public static String firstRejection(double[] requests)",[1085,3213,3214],{},[1089,3215,3216],{},"Starter:",[1136,3218,3220],{"className":1138,"code":3219,"language":1140,"meta":1141,"style":1141},"public class Solution\n{\n    public static void checkAngle(double degrees)\n    {\n        \u002F\u002F TODO: throw IllegalArgumentException when degrees is out of range\n    }\n\n    public static String firstRejection(double[] requests)\n    {\n        \u002F\u002F TODO: return the first rejection's message, or \"all accepted\"\n    }\n}\n",[1117,3221,3222,3227,3231,3236,3240,3245,3249,3253,3258,3262,3267,3271],{"__ignoreMap":1141},[1145,3223,3224],{"class":1147,"line":1148},[1145,3225,3226],{},"public class Solution\n",[1145,3228,3229],{"class":1147,"line":1154},[1145,3230,1157],{},[1145,3232,3233],{"class":1147,"line":1160},[1145,3234,3235],{},"    public static void checkAngle(double degrees)\n",[1145,3237,3238],{"class":1147,"line":1166},[1145,3239,1445],{},[1145,3241,3242],{"class":1147,"line":1172},[1145,3243,3244],{},"        \u002F\u002F TODO: throw IllegalArgumentException when degrees is out of range\n",[1145,3246,3247],{"class":1147,"line":1178},[1145,3248,1457],{},[1145,3250,3251],{"class":1147,"line":1183},[1145,3252,2186],{"emptyLinePlaceholder":2000},[1145,3254,3255],{"class":1147,"line":1189},[1145,3256,3257],{},"    public static String firstRejection(double[] requests)\n",[1145,3259,3260],{"class":1147,"line":1195},[1145,3261,1445],{},[1145,3263,3264],{"class":1147,"line":1201},[1145,3265,3266],{},"        \u002F\u002F TODO: return the first rejection's message, or \"all accepted\"\n",[1145,3268,3269],{"class":1147,"line":1283},[1145,3270,1457],{},[1145,3272,3273],{"class":1147,"line":1289},[1145,3274,1169],{},[1085,3276,3277],{},[1089,3278,3279],{},"Tests:",[3281,3282,3283,3299],"table",{},[3284,3285,3286],"thead",{},[3287,3288,3289,3293,3296],"tr",{},[3290,3291,3292],"th",{},"Visible",[3290,3294,3295],{},"Arguments",[3290,3297,3298],{},"Expected",[3300,3301,3302,3317,3330,3343,3358,3372,3385],"tbody",{},[3287,3303,3304,3308,3313],{},[3305,3306,3307],"td",{},"yes",[3305,3309,3310],{},[1117,3311,3312],{},"new double[] {10.0, 240.0, 90.0}",[3305,3314,3315],{},[1117,3316,3188],{},[3287,3318,3319,3321,3326],{},[3305,3320,3307],{},[3305,3322,3323],{},[1117,3324,3325],{},"new double[] {0.0, 180.0}",[3305,3327,3328],{},[1117,3329,3174],{},[3287,3331,3332,3334,3339],{},[3305,3333,3307],{},[3305,3335,3336],{},[1117,3337,3338],{},"new double[] {-5.0}",[3305,3340,3341],{},[1117,3342,3203],{},[3287,3344,3345,3348,3353],{},[3305,3346,3347],{},"no",[3305,3349,3350],{},[1117,3351,3352],{},"new double[] {200.5, 300.0}",[3305,3354,3355],{},[1117,3356,3357],{},"\"Angle out of range: 200.5\"",[3287,3359,3360,3362,3367],{},[3305,3361,3347],{},[3305,3363,3364],{},[1117,3365,3366],{},"new double[] {90.0, 181.0}",[3305,3368,3369],{},[1117,3370,3371],{},"\"Angle out of range: 181.0\"",[3287,3373,3374,3376,3381],{},[3305,3375,3347],{},[3305,3377,3378],{},[1117,3379,3380],{},"new double[] {}",[3305,3382,3383],{},[1117,3384,3174],{},[3287,3386,3387,3389,3394],{},[3305,3388,3347],{},[3305,3390,3391],{},[1117,3392,3393],{},"new double[] {180.0, 0.0, -0.5, 400.0}",[3305,3395,3396],{},[1117,3397,3398],{},"\"Angle out of range: -0.5\"",[1085,3400,3401],{},[1089,3402,3403],{},"Solution:",[1136,3405,3407],{"className":1138,"code":3406,"language":1140,"meta":1141,"style":1141},"public class Solution\n{\n    public static void checkAngle(double degrees)\n    {\n        if (degrees \u003C 0.0 || degrees > 180.0)\n        {\n            throw new IllegalArgumentException(\"Angle out of range: \" + degrees);\n        }\n    }\n\n    public static String firstRejection(double[] requests)\n    {\n        for (double angle : requests)\n        {\n            try\n            {\n                checkAngle(angle);\n            }\n            catch (IllegalArgumentException e)\n            {\n                return e.getMessage();\n            }\n        }\n        return \"all accepted\";\n    }\n}\n",[1117,3408,3409,3413,3417,3421,3425,3430,3434,3439,3443,3447,3451,3455,3459,3464,3468,3473,3478,3483,3488,3493,3497,3502,3506,3510,3515,3519],{"__ignoreMap":1141},[1145,3410,3411],{"class":1147,"line":1148},[1145,3412,3226],{},[1145,3414,3415],{"class":1147,"line":1154},[1145,3416,1157],{},[1145,3418,3419],{"class":1147,"line":1160},[1145,3420,3235],{},[1145,3422,3423],{"class":1147,"line":1166},[1145,3424,1445],{},[1145,3426,3427],{"class":1147,"line":1172},[1145,3428,3429],{},"        if (degrees \u003C 0.0 || degrees > 180.0)\n",[1145,3431,3432],{"class":1147,"line":1178},[1145,3433,2162],{},[1145,3435,3436],{"class":1147,"line":1183},[1145,3437,3438],{},"            throw new IllegalArgumentException(\"Angle out of range: \" + degrees);\n",[1145,3440,3441],{"class":1147,"line":1189},[1145,3442,2172],{},[1145,3444,3445],{"class":1147,"line":1195},[1145,3446,1457],{},[1145,3448,3449],{"class":1147,"line":1201},[1145,3450,2186],{"emptyLinePlaceholder":2000},[1145,3452,3453],{"class":1147,"line":1283},[1145,3454,3257],{},[1145,3456,3457],{"class":1147,"line":1289},[1145,3458,1445],{},[1145,3460,3461],{"class":1147,"line":1436},[1145,3462,3463],{},"        for (double angle : requests)\n",[1145,3465,3466],{"class":1147,"line":1442},[1145,3467,2162],{},[1145,3469,3470],{"class":1147,"line":1448},[1145,3471,3472],{},"            try\n",[1145,3474,3475],{"class":1147,"line":1454},[1145,3476,3477],{},"            {\n",[1145,3479,3480],{"class":1147,"line":1460},[1145,3481,3482],{},"                checkAngle(angle);\n",[1145,3484,3485],{"class":1147,"line":2217},[1145,3486,3487],{},"            }\n",[1145,3489,3490],{"class":1147,"line":2443},[1145,3491,3492],{},"            catch (IllegalArgumentException e)\n",[1145,3494,3495],{"class":1147,"line":2448},[1145,3496,3477],{},[1145,3498,3499],{"class":1147,"line":2454},[1145,3500,3501],{},"                return e.getMessage();\n",[1145,3503,3504],{"class":1147,"line":2459},[1145,3505,3487],{},[1145,3507,3508],{"class":1147,"line":2465},[1145,3509,2172],{},[1145,3511,3512],{"class":1147,"line":2470},[1145,3513,3514],{},"        return \"all accepted\";\n",[1145,3516,3517],{"class":1147,"line":2476},[1145,3518,1457],{},[1145,3520,3521],{"class":1147,"line":2481},[1145,3522,1169],{},[1085,3524,3525,2711,3527,3529,3530,3532,3533,3529,3535,3537,3538,3540,3541,3543,3544,3546,3547,3549,3550,3552,3553,2020,3556,3559,3560,2020,3563,3566,3567,2020,3569,3571],{},[1089,3526,2710],{},[1117,3528,3126],{}," is the ",[1117,3531,1693],{}," side: it builds the exception with a message that includes the\nbad value. ",[1117,3534,3147],{},[1117,3536,1114],{}," side: the ",[1117,3539,1130],{}," wraps the call that might throw,\nand the ",[1117,3542,1114],{}," for ",[1117,3545,2111],{}," reports ",[1117,3548,1802],{}," instead of ignoring the\nproblem. Returning from inside the ",[1117,3551,1114],{}," stops at the first rejection. Without that, the loop\nkeeps going and ends up reporting a later rejection, which the hidden tests with two bad angles\ncatch. The ",[1117,3554,3555],{},"\u003C",[1117,3557,3558],{},">"," (not ",[1117,3561,3562],{},"\u003C=",[1117,3564,3565],{},">=",") keep ",[1117,3568,3116],{},[1117,3570,3120],{}," legal.",[1979,3573,1981],{},{"title":1141,"searchDepth":1154,"depth":1154,"links":3575},[3576,3577,3578],{"id":2611,"depth":1154,"text":2612},{"id":2761,"depth":1154,"text":2762},{"id":3101,"depth":1154,"text":3102},{"outlineRef":1998,"pairsWith":2598,"status":3580},"new — authored exercises (Multiple Choice + Micro-Parsons + Coding)",{"title":936,"description":1141},"PPTTz6yTggNRNQc5oKc2j2y5RnXNFt6r1PapiS20f4k",1792718166061]