In this level, we touched on several new topics: what literals are, what escaping is, and why escape sequences came into existence. And also we continued to get to know classes. This time around our agenda featured the String class, as well as the nuances of working with strings. Before moving on, make sure you've got a solid understanding of all this.

Escaping characters

You'll gradually learn how to escape characters, even if it seems at present that there are too many rules. It doesn't hurt to read something extra on the topic. For example, there's this helpful article. You can also add it to your bookmarks and periodically take a peek until you no longer need it!


A lecture snippet with a mentor as part of the Codegym University course. Sign up for the full course.


undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
There are various kinds of apples
Fix a mistake in the code so that the program displays the phrase: "The phones are the same".
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
Every letter is lowercase
The program should read a string from the console and display it in all lowercase letters. Fix a mistake in the code, so that the program works correctly.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
Forgotten initialization
In this program, an array is filled with the numbers from 0 to 9 and displayed on the screen: But thanks to an error, the program doesn't compile. Make the program compile and work correctly.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
Instance field shadowing
The main method calls the add method, which should increase the value of the salary field of the Solution class by the passed value, but we get 0 when we output the salary field. Make the program work correctly.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
Feel like a university dean
We have a student group at a university and a method that should remove a specific student from the group, but for some reason it doesn't work. Your task is to find the error and fix it so that the exclude method does actually remove the student.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
MacCoffee 3 in 1
We have a set of classes for making 3-in-1 coffee, but for some reason the coffee won't brew — the task does not compile at present. Find and fix one mistake in the code.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
Making a list of students
The main method should add two students to an array and then display on the console using the printStudents method. Make corrections in the main method so that the program works.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
Student
The main method of the Solution class creates an instance of the Student class with a specific name, but the program does not compile. You need to fix an error in the Student class to allow the program to compile and display the student's name on the console when it runs.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
An inherited phone
The extends and implements keywords must be correctly positioned in the provided classes to allow the program to compile.
undefined
11
Task
New Java Syntax, level 11, lesson 6
Locked
Digits as text
The program converts digits to text. The Solution class has a static digitToText(char) method, which returns the textual representation of digits. In the main method, a number is translated into a textual representation, but only "nine nine ..." is displayed. Add the required number of break stateme