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 pro.java.factory1; | |
import static pro.java.util.Print.*; | |
// Пример фабричных методов. Делаем фабрику сервисов | |
// это то, что будет выпускать наша фабрика, это продукт | |
interface Service { | |
void method1(); | |
void method2(); |
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
import java.math.BigDecimal; | |
import static pro.java.util.Print.*; | |
public class BigDecimalClass { | |
public static void main(String[] args) { | |
// Примеры работы с BigDecimal | |
// пример сути проблемы с точностью представления double | |
double d1 = 2; |
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
import static pro.java.util.Print.println; | |
import java.math.BigInteger; | |
import java.util.Random; | |
public class BigIntegerClass { | |
public static void main(String[] args) { | |
// Примеры работы с BigInteger |