Given the following main method: public class DoWhile14 { public static void main(String[] args) { int num=5; do { System.out.print(num--+" "); }while(num==0); } } What is the result? A. 5 4 3 2 1 0 B. 5 4 3 2 1 C. 4 2 1 D. 5 E. Nothing is printed 정답: D 해설: do while은 do를 먼저 실행하고 while문 이 참이면 do를 계속 실행한다. while문에 거짓이면 실행안한다. 여기서는 do를 먼저 실행해서 5를 출력하고 while문에서 num이 0이 아니니까 빠져나간다. 결과: 5
Given the code fragment: public class Switch13 { public static void main(String[] args) { boolean opt=true; switch(opt) { case true: System.out.print("True"); break; default: System.out.print("***"); } System.out.println("Done"); } } Which modification enables the code fragment to print TrueDone? A. Replace line 5 With String opt="true"; Replace line 7 with case "true": B. Replace line 5 with bo..
- Total
- Today
- Yesterday
- MySQL
- xe애드온
- ocajp
- webix
- 문자열
- 라이믹스
- esql
- 자바 smtp
- 파싱
- KG
- C언어
- ocjap
- C
- proc
- 파이썬
- 자바
- XE3
- 오라클
- xe addon
- php
- 포인터
- 인포믹스
- 스크래핑
- EC
- 프로씨
- 이클립스
- JDBC
- 플러터
- XE
- Python
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
