분류 전체보기
-
-
간단한 계산기JAVA 코드 2019. 2. 21. 11:45
calc.class 부분 public class calc { public static int add(int a, int b){return a+b;} public static int sub(int a, int b){return a-b;} public static int mul(int a, int b){return a*b;} public static int div(int a, int b){return a/b;} public static void show(String[] arr , int n) { for(int i=0;i
-
Server / Client 간 Thread를 이용한 1:1 실시간 채팅JAVA 코드 2019. 2. 21. 11:40
-Server 소스import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.Collections; import java.util.HashMap; import java.util.Scanner;public class Server { public void start(){ ServerSocket serverSocket = null; Socket socket = null; try { serverSocket = new ServerSocket(5555); System.out.prin..