Collection은 다수의 데이터를 쉽게 처리 하도록 표준화된 방법을 제공하는 클래스들을 지칭한다. Collection인터페이스 Map ↗ ↖ List인터페이스 Set인터페이스 List와 Set인터페이스를 공통부분을 추출해서 Collection인터페이스를 정의하였다. Map은 다른 두 인터페이스와 달리 두 가지의 데이터를 다루기 때문에 같은 계층에 포함되지 못하였다. 컬렉션 클래스 List - 저장 순서를 유지하고, 데이터 중복 허용 종류 : ArrayList, LinkedList, stack Set - 저장 순서를 유지하지 않고, 중복도 허용하지 않음. 종류 : HashSet, TreeSet Map - (키, 값)의 형태로 저장되어 저장 순서를 유지하지 않고 값만 중복 허용 종류 : HashMap, ..
문서객체모델은 웹브라우저가 HTML페이지를 인식하는 방식이라고 책에 쓰여져 있습니다. 저는 이 내용을 이해하지 못해 그냥 HTML에서 문서객체를 다루는 방식으로 해석하겠습니다. 문서객체는 자바스크립트 상에서 요소의 값을 가져와서 객체에 대입하였을 때 해당 객체를 문서객체라고 합니다. Colored By Color Scripter™ 1 var targets = document.getElementById('targets'); 위에 보시는 것처럼 targets는 하나의 문서객체입니다. 요소는 요소노드와 텍스트노드가 존재합니다. 요소노드는 ,,같은 태그의 이름인 table, h1, div를 지칭합니다. 텍스트노드는 실제적으로 텍스트형태의 값을 지니는 노드를 뜻 합니다. 예를 들어 춘이 같이 '춘이'라는 값이 하..
자바스크립트에서 가변인자 함수라는게 있다. 가변인자 함수는 함수의 매개변수가 함수 호출시 각각 다를 수 있다. 자바스크립트의 모든 함수는 내부에 arguments라는 변수를 갖는다. arguments는 매개변수의 배열로써 arguments.length 는 매개변수로 넘어온 배열의 길이를 나타내고, argument[index] 는 각각의 인덱스의 매개변수로 넘어온 값을 나타낸다. 사용방법 var func = function (){ var out=0; for(var i=0; i
자바스크립트 자료형중에 객체가 있다. 객체는 키와 값으로 매칭되어 생성된다. 객체의 접근은 단순 for문으로 접근하면 문제가 있다고 한다.(직접 해보시길...) 객체의 접근은 단순 for문 말고 for in 문으로 접근해야 한다고 한다. 다음의 코드는 객체의 생성방법과 with키워드의 사용방법 배열로 객체를 다루는 방법을 간략하게 코딩해본 것이다. 결과 화면 function Student(name){ this.name = name; } Student.prototype.getStudent = function(){ outs = this.name + '\n'; outs += this.ban + '\n'; return outs; }; //생성자 함수에 함수를 지정하지 않고 객체의 프로토타입에 함수를 지정해 놓으..
예외처리는 프로그램 실행도중 예외가 발생 하였을 때 프로그램의 비정상적 종료를 막기 위해 적절한 처리를 해주는 것입니다. 에러는 컴파일에러와 런타임에러로 나뉩니다. 컴파일 에러는 말 그대로 프로그램의 컴파일시 나는 에러이고런타임 에러는 프로그램의 실행도중에 발생하는 에러입니다. 모든 예외 클래스들의 조상은 Exception클래스입니다.Exception클래스의 조상은 Throwable이구요Throwable의 조상은 최고 조상인 Object입니다. Exception클래스들의 자손은 checked예외와 unchecked예외가 있습니다.Exception클래스의 RuntimeException과 그 자손들만이 unchecked예외이고그 외 나머지 Exception클래스의 자손은 checked예외입니다. 자바 api..
서블릿이란 자바를 기반으로한 웹어플리케이션 프로그래밍 기술입니다. 서블릿은 자바의 형태로 작성이 되기 때문에 서블릿 클래스가 컴파일 되기만하면 어떤 운영체제에서든지 사용할 수 있어 이식성이 좋습니다. 하지만 서블릿기술은 HttpServlet클래스를 상속받아야 하기때문에 객체지향으로 봤을 때 서블릿 클래스 자체에서 상속을 못받는 것은 재사용성에 있어서 단점이 아닌가 싶습니다. 그리고 서블릿 클래스 자체에서 HttpServletResponse타입의 getWriter객체를 얻어와 html코드를 생성하는 것은 디자이너와의 협력관계나 코드의 가독성을 많이 떨어지게 하는 점도 좋지 않은것 같습니다.
2진수는 1과 0으로 이루어진 수이다. 10진수는 0~9까지의 수이다. 8진수는 0~7까지의 수이다. 16진수는 0~9 A~F까지의 수이다. 단일로 나타낼 수 있는 값이 0부터 9까지이기 때문에 문자로 대체된다. n진수의 10진수로의 변환 임의의 진수를 10진수로 변환하는 방법은 쉽다. 맨 우측의 가장 작은 값을 시작으로 해서 인덱스(n)를 0으로 잡는다고 하자 만약 1100이라는 이진수가 있다면 맨마지막 값(오른쪽 첫번째)인 0의 n값은 0이고, 그 다음에 위치하는 0의 n값은 1이다. 이렇게 차례대로 2, 3......를 가지게 될 것이다. 이제 각 자리는 2진수이기 때문에 (2ⁿ x 자리값)으로 계산해서 처리해주고, 다시 그 값들을 전부 더해주면 된다. 그렇기 때문에 최종적으로 계산형태는 (1 x ..
1. 네이버 스마트 에디터 파일을 다운 받습니다. http://dev.naver.com/projects/smarteditor/ 2. 스마트 에디터 압축 푼 폴더를 프로젝트의 적절한 경로에 위치시킵니다. (저 같은 경우는 resources/하위 디렉토리에 두었음) 3. 스마트에디터를 적용할 jsp페이지에 HuskyEZCreator.js 파일(스마트에디터 폴더에 있음)을 포함시켜줍니다. 4. 스마트에디터를 적용할 jsp(VIEW)페이지에 textarea태그 밑에 보이는 스크립트처럼 넣어줍니다. 이때 textarea id와 스크립트 안에 보이는 elplaceHolder라는 객체의 값이 동일해야 합니다. 4. 다 하셨으면 스마트에디터에서 입력한 값을 불러와서 textarea태그의 내용에 집어 넣어야 됩니다. v..
증감 연산자(++, --) 피연산자의 값을 1을 더하거나 1을 빼는 연산자. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 public class OperatorTest { public static void main(String[] args) { //증감문 전위형 후위형에 대하여 int i = 0, j = 0, k = 0; //1.증감 연산자에는 전위형, 후위형이 있는데 단독으로 쓰일 경우에는 두 값이 1이 증가한다는데는 차이가 없다 //전위형 같은 경우에는 먼저 변수값을 증가하거나 감소시키기 때문에 문제가 없다 i++; ++j; System.out.println("변수 i ..