본문 바로가기

Java22

Passing String Array Parameter public class StringArrayParameter { public static void main(String[] args) { String[] strArray = new String[]{"Foo","Bar","Baz"}; stringConcat (strArray); Integer[] intArray = new Integer[]{1,2,3}; integerConcat (intArray); } static void stringConcat (String ... strings) { StringBuilder sb = new StringBuilder (); for (int i = 0; i < strings.length; i++) sb.append (strings [i]); System.out.printl.. 2014. 12. 5.
[JAVA] 접근 변경자 ( public, protected, default, private ) 출처 : http://uniksy1106.tistory.com/173 자바(JAVA)에는 총 4가지의 접근 변경자가 있다. 보통 많이 쓰는 것은 2가자이며, default는 아무것도 쓰지 않으면 적용이 되는 것이다. 그럼 자바(JAVA)에서의 접근 변경자에 대해서 간단히 알아보자 @_@ + 접근 허용 가능 범위 public > protected > default >private 접근 범위는 왼쪽일 수록 크다고 보면된다. 위의 접근 변경자중 가장많이 쓰는 것은 public / private가 아닐까 싶다. 당연히 이부분은 사람마다 조금씩 차이가 있을수 있으나 대부분 이와 같지 않을까 ^^;;; 생각된다. - public : 클래스, 변수, 메소드 생성자 등의 모든 접근을 허용한다. 보통 상수(static .. 2014. 5. 13.
[Java] JSP page Directive (1) info 속성 2014. 5. 7.
[Java] 언어별 no-cache 리스트 HTML ASP JSP PHP WML .. .. JSP의 사용예 테스트 페이지 만료,캐쉬설정 Expires Pragma Cache-Control no-cache 만료 및 Expires 헤더 만료일을 지정하는 헤더 Cache-Control 헤더 IE는 HTTP 1.1 Cache-Control 헤더를 지원한다 Pragma:no-cache 헤더 레거시 HTTP 1.0 서버는 Cache-Control 헤더를 사용할 수 없다. 이전 버전과 HTTP 1.0 서버와의 호환을 위해 Internet Explorer는 HTTP Pragma:no-cache 헤더의 특수한 사용을 지원한다 웹서버의 설정 또는 기타 각 프로그램에서 코딩으로도 제어 할 수 있다. [IIS] [HTML예제] [ASP예제] HTTP RFC문서 Hyp.. 2014. 5. 7.
[Java] 카멜, 파스칼 표기법 ( Camel, Pascal ) # 링크 : http://lbiryu.blog.me/30034271341 # 카멜 표기법 : 자바와 C# 에서 많이 사용되는 표기법이다. 함수 (메서드) 와 변수에 주로 사용된다. 변수의 형태가 낙타 등의 혹과 비슷하다고 해서 카멜 표기법이라 부르며 단어와 단어가 만나면 뒤에 오는 단어의 첫글자를 대문자로 써준다. ex) String myName; // my 라는 단어와 name 이라는 단어가 만난다 뒤의 단어 Name 의 첫글자 N을 대문자로 해준다. String productName; // 위의 myName 과 동일 char gender; // 하나의 단어로 구성된 변수임으로 모두 소문자로 적어준다. # 파스칼 표기법 : 자바와 C#, C, C++ 등 다양한 언어에서 사용되는 표기법이다. 모든 단어의.. 2014. 5. 7.
[Java] ServletContextListener Test ■ ServletContextListener Test ( http://www.mkyong.com/servlet/what-is-listener-servletcontextlistener-example/ ) 1. ServletContextListener Example 1) Create a class and implement the ServletContextListener interface package com.mkyong; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class AppServletContextListener implements ServletContextListener{ @.. 2014. 5. 7.