4월 15, 2018의 게시물 표시

pk, fk, unique의 제약조건

http://egloos.zum.com/sweeper/v/3005563

자바 stack 사용하기

import java.util.Stack; public class StackExample {     public static void main(String[] args) {         Stack stack = new Stack<>();                  // 데이터 입력         stack.push(5);         stack.push(4);         stack.push(3);         stack.push(2);         stack.push(1);                  // 데이터 출력         System.out.println("마지막에 넣은 데이터부터 출력..");         System.out.println(stack.pop());         System.out.println(stack.pop());         System.out.println(stack.pop());         System.out.println(stack.pop()); ...

10진수<->2진수, 8진수, 16진수

자바 2진수, 8진수, 16진수 변환 시에는 Integer 클래스 API를 활용하면 편하다. (참고 :  https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html ) 10진수 -> 2진수, 8진수, 16진수 변환 1 2 3 4 5 6 7 8 int  num  =   77 ; String  a2  =  Integer.toBinaryString(num);   // 10진수 -> 2진수 String  a8 =  Integer.toOctalString(num);     // 10진수 -> 8진수 String  a16  =  Integer.toHexString(num);     // 10진수 -> 16진수 System . out . println ( "2 진수 : "   +  a2); System . out . println ( "8 진수 : "   +  a8); System . out . println ( "16 진수 : "   +  a16); cs 결과 1 2 3 2  진수 :  1001101 8  진수 :  115 16  진수 : 4d 2진수, 8진수, 16진수 -> 10진수로 변환 1 2 3 4 5 6 7 8 ...

MyLogger만들어서 print하기

public class MyLogger { private static boolean print = true; public static void Log(String str) { if(print) { System.out.println(str); } } public static void Log(String str, boolean flag) { if(print) { if(flag) System.out.println(str); } } }

동적프로그래밍(동전)

https://gist.github.com/developer-sdk/65e7f5491489a747040b1dd532cc7450

insert, update의 외래키 제약조건

http://tibang.tistory.com/entry/%EC%B0%B8%EC%A1%B0%ED%82%A4%EC%99%B8%EB%9E%98%ED%82%A4-FORIGN-KEY