본문 바로가기

반응형

java

한글의 자모 분해 & 자모 합치기 아래는 한글 자모 분리하는 예제입니다. /** * @(#) SplitHangulJaMo.java * * @date 2001/04/20 * @author Pilho Kim [phkim@cluecom.co.kr] */ ///////////////////////////////////////////////// // 0xAC00 ~ 0xD7A3 (11172 자) // // 초성: ㄱ ㄲ ㄴ ㄷ ㄸ ㄹ ㅁ ㅂ ㅃ ㅅ ㅆ ㅇ ㅈ ㅉ ㅊ ㅋ ㅌ ㅍ ㅎ // 중성: ㅏ ㅐ ㅑ ㅒ ㅓ ㅔ ㅕ ㅖ ㅗ ㅘ ㅙ ㅚ ㅛ ㅜ ㅝ ㅞ ㅟ ㅠ ㅡ ㅢ ㅣ // 종성: fill ㄱ ㄲ ㄳ ㄴ ㄵ ㄶ ㄷ ㄹ ㄺ ㄻ ㄼ ㄽ ㄾ ㄿ ㅀ ㅁ ㅂ ㅄ ㅅ ㅆ ㅇ ㅈ ㅊ ㅋ ㅌ ㅍ ㅎ ////////////////////////////////////.. 더보기
WindowListener 이벤트 간단하게 처리하기 WindowListener windowListener = new WindowAdapter() { public void windowClosing(WindowEvent windowEvent) { System.out.println("Frame closed"); windowEvent.getWindow().dispose(); } }; ----------- frame.addWindowListener(windowListener); 더보기
Using Runnable Interface class MyThread implements Runnable { public void run() { //구현부 } } 이런식으로 구현을 하고, MyThread를 사용하는 방법은 MyThread만으로는 instance화 해봐야 thread를 시작할 수 없다. 고로 thread에 MyThread를 인수로 넣어서 Upcasting을 이용하여 start()를 실행할 수 있다. 다만, Thread를 이용하여 extends한 class는 곧바로 instace화해서 start()할 수 있다. 고로.. 위의 것은, new Thread(new MyThread).start(); //풀어쓴다면 MyThread myThread = new MyThread(); Thread thread = new Thread(myThread).. 더보기
java.lang.Object 보기.. 실제로 보면 실제 소스코드는 50line안쪽인듯하다. 하지만 생각보다 볼게 많다. 하루에 클래스 두어개만 보아도 대단한 거다. ㅡㅡ; /* * @(#)Object.java 1.68 04/04/08 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package java.lang; /** * Class Object is the root of the class hierarchy. * Every class has Object as a superclass. All objects, * including arrays, implemen.. 더보기
Pass By Value or Pass By Reference? 자바에서 Pass by Refrence 와 Pass by Value 참조 : http://www.impunity.co.kr/~rfm98/ver3/main.html Jstorm에서 가져온 내용입니다. 며칠전 Jstorm세미나를 하다가 한 친구가 자바는 Pass by Value인지 아니면 Pass by Reference인지를 물어봤습니다. 그래서 저는 두서없이 primitive type은 Pass by Value이고 객체는 Pass by Reference라고 대충 말해줬습니다. 하지만 사실 엄밀한 의미에서 말하면 모든 자바에서의 값넘김은 Pass by Value이죠... 어쨌든 그 미묘한 차이를 이해하는 것은 의외로 상당히 중요할 듯 싶어서 외국 문서 몇개를 뒤져서 쉽게 설명이 가능하도록 글을 써봅니다. 자.. 더보기
추상클래스(abstract)와 인터페이스(Interface)를 사용하는 목적 ########################################################################## # 추상클래스(abstract)와 인터페이스(Interface)를 사용하는 목적 # ########################################################################## 작성자 : 장형화(hhjang97@venus.uos.ac.kr) 작성일 : 2005. 02. 14 수정일 : 원본 : http://kin.naver.com/browse/db_detail.php?d1id=1&dir_id=10106&docid=923571 설명 : 추상클래스와 인터페이스 설명 ################################# #####.. 더보기
Data Types http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html Java에서 사용하는 a variable of primitive type의 각 데이터값을 보여주는 글 http://java.sun.com/docs/books/tutorial/java/nutsandbolts/ex5/MaxVariablesDemo.java Java에서 지원하는 primitive variable의 최대최소값을 찾는 예제 /** * MaxVariablesDemo.java is an application that compiles and runs * under J2SE 5.0. It requires no other files. */ public class MaxVaria.. 더보기
Java 프로그램을 exe로 만들기 http://jsmooth.sourceforge.net/ JSmooth is a Java Executable Wrapper that makes a standard Windows executable binary (.exe) from a jar file. It makes java deployment much smoother and user-friendly, as it is able to find a Java VM by itself. When no VM is available, it provides feed-back to the users, and can launch the default web browser to an URL that explains how to download a Java VM. Jsmoo.. 더보기

반응형