Given the code fragment: package ocjap; public class Arr18 { public static void main(String[] args) { /* insert code here */ int array[2]; array[0]=10; array[1]=20; System.out.print(array[0]+":"+array[1]); } } Which code fragment, when inserted at line 3, enables the code to print 10:20? A. int[] array=new int[2]; B. int[] array; array=int[2]; C. int array=new int[2]; D. int array[2]; 정답: A 해설: ..
20 Which three are advatages of the Java exception mechanism? (Choose three.) A. Improves the program structure because the error handing code is separated from the normal program function B. Provides a set of standard exceptions that covers all the possible errors C. Improves the program structure because the programmer can choose where to handle exceptions D. Improves the program structure bec..
Given: package ocjap; class Student{ String name; public Student(String name){ this.name=name; } } public class Test86 { public static void main(String[] args) { Student[] students=new Student[3]; students[1]=new Student("Richard"); students[2]=new Student("Donald"); for (Student s : students) { System.out.println(""+s.name); } } } What is the result? A. null Richard Donald B. Richard Donald C. ..
package ocjap; public class Arr64 { public static void main(String[] args) { int numbers[]; numbers=new int[2]; numbers[0]=10; numbers[1]=20; numbers=new int[4]; numbers[2]=30; numbers[3]=40; for(int x:numbers){ System.out.print(" "+x); } } } What is the result? A. 10 20 30 40 B. 0 0 30 40 C. Compliation fails. D. An exception is thrown at runtime. 정답: B 해설: int 배열이기 때문에 0으로 초기화 된다. 때문에 new int[..
Given the code fragment: package ocjap; public class arr49 { public static void main(String[] args) { int n[][] = { {1,3}, {2,4} }; for (int i = n.length-1; i >=0; i--) { for(int y : n[i]){ System.out.print(y); } } } } What is the result? A. 1324 B. 2313 C. 3142 D. 2413 정답: D 해설: package ocjap; public class arr49 { public static void main(String[] args) { int n[][] = { {1,3}, {2,4} }; System.out..
Given the code fragment package ocjap; public class Test12 { void readCard(int cardNo) throws Exception{ System.out.println("Reading Card"); } void checkCard(int cardNo) throws RuntimeException{ // line n1 System.out.println("Checking Card"); } public static void main(String[] args) { Test12 ex =new Test12(); int cardNo=12345; ex.checkCard(cardNo); // line n2 ex.readCard(cardNo); // line n3 } } ..
- Total
- Today
- Yesterday
- 오라클
- 프로씨
- 이클립스
- KG
- MySQL
- Python
- xe애드온
- XE3
- 스크래핑
- C언어
- C
- php
- 플러터
- proc
- 포인터
- 자바
- 자바 smtp
- 라이믹스
- 인포믹스
- 문자열
- xe addon
- ocjap
- esql
- ocajp
- JDBC
- 파이썬
- 파싱
- XE
- EC
- webix
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
