Множество всех животных : 8 уровень, 11 лекция Java Syntax
Set of all animals : level 8, lesson 11 JavaRush
Задание от JavaRush
Множество всех животных : 8 уровень, 11 лекция I Java Syntax
1. Внутри класса Solution создать public static классы Cat, Dog без конструктора или с конструктором без параметров.
2. Реализовать метод createCats, который должен возвращать множество с 4 котами.
3. Реализовать метод createDogs, который должен возвращать множество с 3 собаками.
4. Реализовать метод join, который должен возвращать объединенное множество всех животных - всех котов и собак.
5. Реализовать метод removeCats, который должен удалять из множества pets всех котов, которые есть в множестве cats.
6. Реализовать метод printPets, который должен выводить на экран всех животных, которые в нем есть.
Каждое животное с новой строки.
The task from JavaRush
Set of all animals : level 8, lesson 11 I Java Syntax
1. Inside the Solution class, create public static Cat, Dog classes without a constructor or with a constructor without parameters.
2. Implement the createCats method, which should return a set with 4 cats.
3. Implement the createDogs method, which should return a set with 3 dogs.
4. Implement the join method,
which should return the combined set of all animals - all cats and dogs.
5. Implement the removeCats method, which should remove all cats from the set of pets that are in the set cats.
6. Implement the printPets method, which should display all the animals that it contains.
Each animal on a new line.
Java Developer
Android Studio
Язык программирования Джава
Андроид Студио
Repeat after me, then delete and write the code from memory. Create a new task and write the program yourself
Повтори за мной, затем удали и напиши код по памяти. Придумай новое задание и напиши программу самостоятельно
Thank you for watching
Спасибо за просмотр