기초는 중요하다.
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...
-
XE(제로보드) 내 게시판의 첨부용량 변경 ㅁ 개요 ↑ XE 구축시 초기 첨부파일 용량은 2M로 제한되어 있음에 데이터 자료실을 만들기 위해 용량을 명령어를 이용하여 추가 혹은 감소 시키도록 하고자 한다. ㅁ 구현 ↑ 처음 ...
-
일단 ssh 프로그램으로 apm 셋팅을 하려고 했으나 apt-get이 계속 파일 위치를 잡지 못했다. (404 not found....) 그래서 구글링 결과 apt의 리스트 변수 목록을 제거하고 새로 업데이트 하는 명령어를 찾음 :)...
-
□ native modifier 는 자바가 아닌 다른 언어로 작성된 코드를 자바에서 사용하기 위한 것 □ transient modifier 는 객체가 직렬 화되는 과정에서 해당 필드가 저장되지 않아야 한다는 것을 알리기 위해 사용 ...
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.