课程: Java Practice: Collections
Exploring the lab environment
- [Instructor] This course includes 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 can see how your code is being used in the bottom right, and a console for output in the bottom left. You can drag these handles around to allocate space as you'd like. For example, if you would like more space for the answer, you can click and drag this bar to the left. If you want to see the console better, you can click and drag this up, et cetera. To get even more horizontal space for the code editors, you can collapse the course's 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. For example, for this one, this data type is an array of integers. You'll also see that noted in the instructions. For example, the numbers parameter is an array of integers type, so just like you see here, you're going to see that in all of the instructions, a description of the data type of each parameter. The constraints section has useful information about the parameters that will be passed in. The examples show different parameter values and what result would be returned for each of those test cases. Create your answer in the top right code editor. There are comments in the starting code showing where to put your solution. When you click test my code, you'll see a message indicating whether your code returned a correct result. So for example, with the default value here, if I hit test my code, then I'm going to see that the code was unsuccessful. If I paste in a value that solves the challenge, I'll just have to import that class first, and then I test my code. I'm going to see in the console that I was successful and what my code returned. If your code isn't successful, you can ask for help. So I'll change this back to unsuccessful code by returning zero, and then I'm going to hit test my code, and we'll see that message in the output window. You'll also see this message for what you can do if you need help. For that, you can modify the values of these variables. If you want to see the expected result, set that value to true. If you want to see some hints, set this value to true, and then when you test your code and have an incorrect result, then you're going to see the expected result and a hint. So, regardless of whether your answer is successful, you're going to see output in the console after you hit the test my code button. If any messages are too long to fit in that area, you can scroll sideways to see all of the text. When you've finished each code challenge, return to the course's table of contents and click the next video to see my solution.