This file contains 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
Show hidden characters
// Файл "tsconfig.json": | |
// - устанавливает корневой каталог проекта TypeScript; | |
// - выполняет настройку параметров компиляции; | |
// - устанавливает файлы проекта. | |
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта. | |
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта. | |
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга. | |
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути. | |
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию. | |
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json". |
This file contains 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 com.javarush.test.level17.lesson10.home05; | |
/* Лишняя синхронизация | |
synchronized существенно замедляет программу, поэтому убери избыточность synchronized внутри методов | |
*/ | |
public class Solution { | |
char[] value; | |
int count; |
This file contains 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 com.javarush.test.level17.lesson10.home09; | |
import java.io.IOException; | |
public class CorruptedDataException extends IOException { | |
} |
This file contains 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 com.javarush.test.level17.lesson10.home08; | |
import java.math.BigDecimal; | |
public class BankAccount { | |
private BigDecimal balance; | |
private String owner; | |
public BankAccount(String owner) { | |
this(BigDecimal.ZERO, owner); |
This file contains 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 com.javarush.test.level17.lesson10.home07; | |
import java.util.HashMap; | |
import java.util.Map; | |
/* ApplicationContext | |
ApplicationContext будет доступен множеству нитей. | |
Сделать так, чтобы данные не терялись: подумай, какое ключевое слово необходимо поставить и где. | |
*/ |
This file contains 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 com.javarush.test.level17.lesson10.home04; | |
/* Синхронизированные методы | |
Установить модификатор synchronized только тем методам, которым необходимо | |
*/ | |
public class Solution { | |
private double param = Math.random(); | |
private void method0() { |
This file contains 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 com.javarush.test.level17.lesson10.home03; | |
public class Drug { | |
private String name; | |
private String description; | |
public String getName() { | |
return name; | |
} |
This file contains 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 com.javarush.test.level17.lesson10.home02; | |
/* Comparable | |
Реализуйте интерфейс Comparable<Beach> в классе Beach, который будет использоваться нитями. | |
*/ | |
import java.util.TreeSet; | |
public class Beach implements Comparable<Beach> { | |
private String name; //название |
This file contains 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 com.javarush.test.level17.lesson10.home01; | |
import java.util.*; | |
/* Общий список | |
1. Изменить класс Solution так, чтобы он стал списком. (Необходимо реализовать интерфейс java.util.List). | |
2. Список Solution должен работать только с целыми числами Long. | |
3. Воспользуйтесь полем original. | |
4. Список будет использоваться нитями, поэтому позаботьтесь, чтобы все методы были синхронизированы. | |
*/ |
This file contains 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 com.javarush.test.level17.lesson06.task02; | |
/* Предложения | |
Не используя synchronized сделайте так, чтобы количество сделанных и принятых предложений было одинаковым. | |
*/ | |
public class Solution { | |
public static volatile int proposal = 0; | |
public static void main(String[] args) { |
NewerOlder