1. x진수 출력
int numBase2 = 0b1100;
System.out.println("numBase2 = " + numBase2);
int numBase8 = 014;
System.out.println("numBase8 = " + numBase8);
int numBase16 = 0xc;
System.out.println("numBase16 = " + numBase16);
System.out.println("0b"+ Integer.toBinaryString(numBase2));
System.out.println("0"+Integer.toOctalString(numBase8));
System.out.println("0x"+Integer.toHexString(numBase16));
2. Char형 Int형으로 출력시 Ascii코드 값으로 출력
char keyFirst = 'a';
System.out.println("keyFirst = " + keyFirst);
char keyLast = 'z';
System.out.println("keyLast = " + keyLast);
System.out.println((int)keyFirst);
System.out.println((int)keyLast);
3. String -> 한단어 씩 String[] 배열로 변환
String str = "ABCDE";
String[] str_array = str.split("");
4. replace
String a = "Hello myunghoon!!";
a.replace("myunghoon", "World");
5. substring
String b = a.substring(0,2);
6. toUpperCase
string c = b.toUpperCase;
7. String 누적표현
String a = "01234";
String b = "56789"
a +=b;
8. ArrayList
ArrayList l1 = new ArrayList();
l1.add(1);
l1.add("HI");
l1.add(2);
l1.add("World!");
ArrayList<Integer> l1 = new ArrayList<>();
l1.add(0, 3);
l1.get(1);
l1.size();
l1.remove(0);
l1.remove(Integer.valueOf(1));
l1.clear();
l1.sort(Comparator.naturalOrder());
l1.sort(Comparator.reverseOrder());
l1.contains(0); 0데이터 있으면 true
9. 삼항 연산자
int a = 1;
int b = ((a==1) ? 1 : 0);
10. bit 논리 연산자
int a = 5;
int b= 3;
int c = 0;
c = a&b ;
c = a|b ;
c = a^b ;
c = c<<1
c = c>>1