课程: Java Practice: Functional Programming

Exploring the code challenge environment - Java教程

课程: Java Practice: Functional Programming

Exploring the code challenge environment

- [Instructor] This course consists of automated code challenges that appear when you click on the challenge links in the course's table of contents. Each challenge includes instructions and a couple of code editors you can use to create and test your own solution to the challenge. These challenges are hosted by CoderPad, and they appear in the same area of the course page where you watch the course's videos. We recommend using a desktop browser for the best experience with code challenges, but you can use the LinkedIn Learning mobile app if you prefer. The code Challenge has four areas, instructions in the top left, a code editor for your answer in the top right, another code editor where you see how your code is used in the bottom right, and a console for output in the bottom left. You can use these drag handles to allocate space as you like. For example, I'm making a little bit more room for my code editor. To get even more horizontal space for the code editors, you can collapse the courses table of contents on the left. Each challenge has instructions that include a description of the challenge and the challenge's parameters and desired result. Parameters are values that will be passed into your code, and they have to be of a particular data type. The return value also has to be of a particular type, and you'll see that noted in the instructions. The constraint section has useful information about the parameters that will be passed in. The examples show different versions of the inputs and the matching desired results. Create your answer in the top right code editor. I'm starting with the correct answer, finding the largest number in a numbers array. So when I click test my code, I'll see a positive response in the console output. If your code isn't successful, you can ask for help. So for example, I'm going to comment this line of code out and return a value of zero. Then I'll test my code again. And this time I get a message indicating that I didn't get the answer right. And I also see some hints. I can set this value, show expected result to a value of true. And when I do that and test my code again, this time I'll see the expected result of 19. And I can also set the value of show hints to true. And now when I test my code and get an incorrect result, I'll get a hint for something I might want to try. If at any point these messages are too wide for the window, you can scroll sideways to see all of the text. When you finished each code challenge, you can return to the course's table of contents and click the next video to see my solution to the challenge.

内容