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.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.PrintStream; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.util.HashMap; |
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 net.sinsengumi.fizzbuzz; | |
public class FizzBuzz { | |
public static void main(String[] args) { | |
for (int i = 1; i <= 100; i++) { | |
if (i % 3 == 0 && i % 5 == 0) { | |
System.out.println("FizzBuzz"); | |
} else if (i % 3 == 0) { |
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 java.math.RoundingMode; | |
public class RoundOffError { | |
private static final int DEVIDE_DECIMAL_SCALE = 20; | |
private static final int CALC_DECIMAL_SCALE = 10; | |
public static void main(String[] args) { | |
BigDecimal num3000 = new BigDecimal(3000); |