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
/* | |
Implement the logic of the isModifierSet method, which checks if the passed allModifiers parameter contains the value of a specific modifier specificModifier. | |
*/ | |
package com.javarush.task.task21.task2102; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Modifier; | |
public class Solution { | |
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
/* | |
1. Given the IP address and subnet mask, you need to calculate the network address - implement the getNetAddress method. | |
Use the bitwise conjunction (logical AND) operation. | |
Example: | |
IP address: 11000000 10101000 00000001 00000010 (192.168.1.2) | |
Subnet mask: 11111111 11111111 11111110 00000000 (255.255.254.0) | |
Network address: 11000000 10101000 00000000 00000000 (192.168.0.0) | |
2. Implement the print method, which will output the data in binary code to the console. For IP address (192.168.1.2) |
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
/* | |
In the main method, replace the System.out object with the wrapper wrapper you wrote. | |
Your reader wrapper should output contextual ads to the console after every second println. | |
Call the ready-made printSomething () method, use testString. | |
Return the original stream to the System.out variable. | |
Promotional Text: "CodeGym - Online Java Courses" | |
Output example: | |
first |
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
/* | |
1. Считать с консоли имя файла. Считать содержимое файла. | |
2. Для каждой строки в файле: | |
2.1. переставить все символы в обратном порядке. | |
2.2. вывести на экран. | |
3. Закрыть потоки. | |
Пример тела входного файла: | |
я - программист. | |
Амиго |
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
/* | |
В метод main первым параметром приходит имя файла1, вторым - файла2. | |
Файл1 содержит слова, разделенные пробелом. | |
Записать через запятую в Файл2 слова, длина которых строго больше 6. | |
В конце файла2 запятой не должно быть. | |
Закрыть потоки. | |
Пример выходных данных в файл2: | |
длинное,короткое,аббревиатура | |
*/ | |
package com.javarush.task.task19.task1925; |
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
/* | |
1. In the static block, initialize the map dictionary with [number-word] pairs from 0 to 12 inclusive. | |
For example, 0 - "zero", 1 - "one", 2 - "two" | |
2. Read the file name from the console, read the contents of the file. | |
3. Replace all numbers with words using the map dictionary. | |
4. Display the result on the screen. | |
5. Close streams. | |
Sample data in file: | |
It costs 1 dollar, but this is 12. |
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
/* | |
In the main method, the first parameter comes the name of file1, the second - file2. | |
File1 contains lines with words separated by spaces. | |
Write all words containing numbers, for example, a1 or abc3d, separated by a space into File2. | |
Close streams. | |
*/ | |
package com.javarush.task.task19.task1923; | |
import java.io.*; | |
import java.util.regex.Matcher; |
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
/* | |
Считать с консоли имя файла. | |
Вывести в консоль все строки из файла, которые содержат всего 2 слова из списка words. | |
Закрыть потоки. | |
Пример: | |
words содержит слова А, Б, В | |
Строки: | |
В Б А Д //3 слова из words, не подходит |
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
/* | |
В метод main первым параметром приходит имя файла. | |
В этом файле каждая строка имеет следующий вид: | |
имя день месяц год | |
где [имя] - может состоять из нескольких слов, разделенных пробелами, и имеет тип String. | |
[день] - int, [месяц] - int, [год] - int | |
данные разделены пробелами. | |
Заполнить список PEOPLE используя данные из файла. | |
Закрыть потоки. |
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
/* | |
The main method receives the file name as the first parameter. | |
In this file, each line looks like this: | |
name value | |
where [name] is String, [value] is double. [name] and [value] are separated by a space. | |
For each name, calculate the sum of all its values. | |
Display the names in alphabetical order with the maximum amount to the console. | |
Separate names with a space or print on a new line. | |
Close streams. |
NewerOlder