(문자열을 비교할 때는 ==이 아니라 equals() 메서드를 사용)
긴 문자열 조합
값을 추가할 때엔 append()
메서드
값을 사용하기 위해서는 StringBuffer.toString()
메서드
Integer num1 = new Integer(100);
int num2 = num1.intValue();
Integer num1 = 100; // 박싱
int num2 = num1; // 언박싱
public final static InputStream in // 키보드 입력용 입력 스트림
public final static PrintStream out // 표준 출력을 위한 출력 스트림
public final static PrintStream err // 표준 오류 출력을 위한 출력 스트림
Scanner scanner = new Scanner(System.in);
System.out.println(scanner.next()); // String을 반환
-nextInt() 메서드 사용 시 Integer 범위에서 난수가 나온다.
-파라미터 값으로 숫자 n을 제공한다고 하면, 0부터 n-1까지로 난수의 범위를 설정
-next와 Primitive Type을 결합하여 해당 자료형의 범위 내의 양수에서 난수를 생성
Random random = new Random();
System.out.println(random.nextInt(10)); // 0~9
System.out.println(random.nextDouble()); // 매개변수 X, Double 범위에서 생성
구분자에는 공백, 콤마, 탭 주로 사용