기초는 중요하다.
1. boolean bool = true;
2. if(bool = false) {
3. System.out.println("a");
4. } else if (bool) {
5. System.out.println("c");
6. } else if (!bool) {
7. System.out.println("c");
8. } else {
9. System.out.println("d");
10. }
What is the result?
A. a
B. b
C. c
D. d
E. Compilation fails.
씨. 2번 라인의 경우 앞의 값과 관계없이 대입값이 false 면 false,
대입값이 true면 true
Which statement is true?
A. catch(X x) can catch subclasses of X.
B. The Error class is a RuntimeException.
C. Any statement that can throw an Error must be enclosed in a try block.
D. Any statement that can throw an Exception must be enclosed in a try block.
E. Any statement that can throw a RuntimeException must be enclosed in a try block.
답 : 에이
B : Error 클래스가 있고 그거임.
C : ERROR는 싸도 안됨
D,E : throws가 있잖아.
throws throws 문은 예외를 현재 메소드에 처리하지 않고 상위로 올려 보낸다. 최상위 메소드로 전파가 되었는데도 예외를 처리하지 않으면 Exception 발생.
Which statement is true about assertion in the Java programming language?
A. Assertion expressions should not contain side effects.
B. Assertion expression values can be any primitive type.
C. Assertion should be used for enforcing preconditions on public methods.
D. An AssertionError thrown as a result of a failed assertion should always be handled by the enclosing method.
B. 조건문과 String으로 제한
C. public method에서만 사용할 강제 조건 없음 암때나 사용해도됨.
D. 에러 내고 종료하는게 assert의 본 목적
2011년 2월 25일 금요일
피드 구독하기:
댓글 (Atom)
UPBIT is a South Korean company, and people died of suicide cause of coin investment.
UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...
-
프루나는 이제 믿을만한 공유가 안되고 있다. 젠장. 영화 다운 받아보면 전부 야동이나 포르노류 밖에는 없다. 신고되어 있는 자료부터 보지만 신고가 안되어 있는 것은 제대로 다운도 되지 않는다. 이젠 유료 사이트를 믿을 수 밖엔... ...
-
Intel의 새로운 MMX - "KNI" KNI 는 Katmai New Instruction 의 약자이다 . 아는 분들은 잘 알고있겠지만 KATMAI( 이하 카트마이로 부름 ) 는 인텔의 다음번 펜티엄...
-
C:\program files\ 베이비론 폴더가 있다. 브라우저 창 다닫고 지우고 다시 실행하면 없어진다.
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.