ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 자바
    프로그래밍 언어/데이터 타입 2012. 5. 22. 21:57

    자바 컴파일러는 초기화되지 않은 지역 변수를 사용하는 것을 허락하지 않는다.

    e.g. Point p = new Point(2.0, -3.5); or Point p = null;

    String name = "David";

    int[] powersOfTwo = {1, 2, 4, 8, 16, 32, 64, 128};

    byte[] buffer = new byte[1024];

    char[] password = null;

    c.f. String[] responses = new String[2];

    responses[0] = "..";

    responses[1] = "..";

    c.f. 클래스 필드는 기본값으로 자동 초기화



    final

    상수

    With a primitive, final makes the value a constant, but with an object reference, final makes the reference a constant.


    기본 데이터 형

    .==()

    .!=()


    boolean // 부울형

    부울형 값이 다른 데이터 타입으로 변환되거나 다른 데이터 타입이 부울형으로 변환되는 것은 절대 허용되지 않는다.

    Boolean

    char

    Character

    .isWhitespace()

    .isLetter()

    .toUpperCase()

    정수형

    byte

    Byte -> Number

    short

    Short -> Number

    int

    Integer -> Number

    long

    Long -> Number

    실수형

    float

    Float -> Number

    double

    Double -> Number


    레퍼런스 타입(클래스?)

    new를 사용해서 객체를 생성

    복합(집합)적인 타입


    null


    instanceof 연산자


    .equals()


    클래스

    배열


    문자열

    new 없이도 객체를 생성할 수 있는 유일한 참조 자료형

    c.f.

    Integer refInt1;

    refInt1 = 100;


    String

    참조 자료형 중에서 String 클래스만 사용 가능


    Cloneable // interface

    .clone()

    shallow copy


    * Enumeration(Enum)

    JDK 1.5(J2SE5)


Designed by Tistory.