This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework6; | |
| import java.util.ArrayList; | |
| import java.util.Objects; | |
| import java.util.Scanner; | |
| public class MainHW6 { | |
| public static void main(String[] args) { | |
| // Создаем список ноутбуков | |
| ArrayList<Laptop> laptops = new ArrayList<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework6; | |
| public class Laptop { | |
| private String brand; | |
| private double screenSize; | |
| private int ramSize; | |
| private int ssdSize; | |
| private String color; | |
| // Конструктор класса |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework5; | |
| import java.util.*; | |
| public class MainHW5 { | |
| public static void main(String[] args) { | |
| List<String> employees = Arrays.asList( | |
| "Иван Иванов", | |
| "Светлана Петрова", | |
| "Кристина Белова", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework4; | |
| // Пусть дан LinkedList с несколькими элементами. | |
| // Реализуйте метод, который вернет “перевернутый” список | |
| import java.util.Collections; | |
| import java.util.LinkedList; | |
| public class MainHW4_2 { | |
| public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework4; | |
| // Реализовать консольное приложение, которое: | |
| //Принимает от пользователя и “запоминает” строки. | |
| //Если введено print, выводит строки так, чтобы последняя введенная была первой в списке, а первая - последней. | |
| //Если введено revert, удаляет предыдущую введенную строку из памяти. | |
| import java.util.LinkedList; | |
| import java.util.Scanner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework3; | |
| // 4* Создать список типа ArrayList<String>. Поместить в него как строки, так и целые числа. | |
| // Пройти по списку, найти и удалить целые числа. | |
| import java.util.ArrayList; | |
| public class MainHW3_4 { | |
| public static void main(String[] args) { | |
| ArrayList<String> list = new ArrayList<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework3; | |
| // 2. Задан целочисленный список ArrayList. Найти минимальное, максимальное | |
| // и среднее арифметическое из этого списка. | |
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| public class MainHW3_2 { | |
| public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework3; | |
| // 1. Пусть дан произвольный список целых чисел, удалить из него четные числа | |
| // (в языке уже есть что-то готовое для этого) | |
| import java.util.ArrayList; | |
| public class MainHW3_1 { | |
| public static void main(String[] args) { | |
| ArrayList<Integer> numbers = new ArrayList<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Homework1; | |
| import java.util.Arrays; | |
| public class MainHomework { | |
| public static void main(String[] args) { | |
| System.out.println("Приветcтвую!"); | |
| // 1. Задать одномерный массив и найти в нем минимальный и максимальный элементы | |
| int[] arr = {6, 11, 12, 4, 1, 23, 19, 44, 7}; |