기초는 중요하다.
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( 이하 카트마이로 부름 ) 는 인텔의 다음번 펜티엄...
-
[펌] [UNIX/LINUX 명령어] apropos linux 2005/06/28 22:05 수정 삭제 http://blog.naver.com/wiggyz/80014482910 Mr.You의 블로그 | ?? http:...
-
구글 문제 귀찮아서 이제 대충 뜻만... In a country in which people only want boys……every family continues to have children until they 남자만 원하는 나라가 있다...
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.