Name : OCJP Study
Category : Software
Purpose : JAVA 공부하면서 OCJP 가 합격이 되도록 비나이다.
compatibility : ...
Etc : eclipse
공부한 거는 Post 하자.!!!
JAVA도 공부하면서 OCJP 도 한번에 합격하시기를...
지금 이글을 읽을 정도로 자신의 시간을 투자하는 사람이라면 합격은 당연한것인가. 흠.
그럼 시작.
QUESTION 41
Given a pre-generics implementation of a method:
:
11. public static int sum(List list) {
12. int sum = 0;
13. for ( Iterator iter = list.iterator(); iter.hasNext(); ) {
14. int i = ((Integer)iter.next()).intValue();
15. sum += i;
16. }
17. return sum;
18. }
What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose three.)
:
A. Remove line 14.
B. Replace line 14 with int i = iter.next();
C. Replace line 13 with for (int i : intList) {
D. Replace line 13 with for (Iterator iter : intList) {
E. Replace the method declaration with sum(List<int> intList)
F. Replace the method declaration with sum(List<Integer> intList)
Answer: ACF
QUESTION 42
Given:
23. Object [] myObjects = {
24. new Integer(12),
25. new String("foo"),
26. new Integer(5),
27. new Boolean(true)
28. };
29. Arrays.sort(myObjects);
30. for(int i=0; i<myObjects.length; i++) {
31. System.out.print(myObjects[i].toString());
32. System.out.print(" ");
33. }
What is the result?
: 결과는 무엇인가?
A. Compilation fails due to an error in line 23.
B. Compilation fails due to an error in line 29.
C. A ClassCastException occurs in line 29.
D. A ClassCastException occurs in line 31.
E. The value of all four objects prints in natural order.
Answer: C
QUESTION 43
Given a class Repetition:
: 클래스 반복을 감안할 때
1. package utils;
2.
3. public class Repetition {
4. public static String twice(String s) { return s + s; }
5. }
and given another class Demo:
1. public class Demo {
2. public static void main(String[] args) {
3. System.out.println(twice("pizza"));
4. }
5. }
Which code should be inserted at line 1 of Demo.java to compile and run Demo to print pizzapizza?
:
A. import utils.*;
B. static import utils.*;
C. import utils.Repetition.*;
D. static import utils.Repetition.*;
E. import utils.Repetition.twice();
F. import static utils.Repetition.twice;
G. static import utils.Repetition.twice;
Answer: F
QUESTION 44
A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where the old one is installed. Bob is currently able to run a Java chess program starting from his home directory /home/bob using the command:
java -classpath /test:/home/bob/downloads/*.jar games.Chess
Bob's CLASSPATH is set (at login time) to:
/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar
What is a possible location for the Chess.class file?
: Chess.class 파일에 대한 가능한 위치는 무엇인가?
A. /test/Chess.class
B. /home/bob/Chess.class
C. /test/games/Chess.class
D. /usr/lib/games/Chess.class
E. /home/bob/games/Chess.class
F. inside jarfile /opt/java/lib/Games.jar (with a correct manifest)
G. inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)
Answer: C
QUESTION 45
Given the following directory structure:
bigProject
|--source
| |--Utils.java
|
|--classes
|--
And the following command line invocation:
: 다음의 명령 라인을 호출 :
javac -d classes source/Utils.java
Assume the current directory is bigProject, what is the result?
: 현재 디렉토리가 bigProject라고 가정한다면, 결과는 무엇인가?
A. If the compile is successful, Utils.class is added to the source directory.
B. The compiler returns an invalid flag error.
C. If the compile is successful, Utils.class is added to the classes directory.
D. If the compile is successful, Utils.class is added to the bigProject directory.
Answer: C
QUESTION 46
Which statement is true?
: 어느 문장이 사실인가?
A. A class's finalize() method CANNOT be invoked explicitly.
: 클래스의 Finalize() 메서드를 명시적으로 호출 할 수 없습니다.
B. super.finalize() is called implicitly by any overriding finalize() method.
: super.finalize )는 어떤 오버라이딩 finalize() 메소드에 의해 암시적으로 호출됩니다.
C. The finalize() method for a given object is called no more than once by the garbage collector.
: 지정된 객체의 finalize() 메소드는 가비지 컬렉터에 의해 두 번 이상 더 이상 호출되지 않습니다.
D. The order in which finalize() is called on two objects is based on the order in which the two objects became finalizable.
: 두 개체에서 호출되는 finalize() 순서는 두 객체가 종료 가능한이되는 순서에 기초한다.
Answer: C
QUESTION 47
Given:
1. public class Batman {
2. int squares = 81;
3. public static void main(String[] args) {
4. new Batman().go();
5. }
6. void go() {
7. incr(++squares);
8. System.out.println(squares);
9. }
10. void incr(int squares) { squares += 10; }
11. }
What is the result?
: 결과는 무엇인가?
A. 81
B. 82
C. 91
D. 92
E. Compilation fails.
F. An exception is thrown at runtime.
Answer: B
QUESTION 48
Given:
public class Yippee {
public static void main(String [] args) {
for(int x = 1; x < args.length; x++) {
System.out.print(args[x] + " ");
}
}
}
and two separate command line invocations:
:
java Yippee
java Yippee 1 2 3 4
What is the result?
: 결과는 무엇인가?
A. No output is produced. 1 2 3
B. No output is produced. 2 3 4
C. No output is produced. 1 2 3 4
D. An exception is thrown at runtime. 1 2 3
E. An exception is thrown at runtime. 2 3 4
F. An exception is thrown at runtime. 1 2 3 4
Answer: B
QUESTION 49
Given:
1. public class Pass {
2. public static void main(String [] args) {
3. int x = 5;
4. Pass p = new Pass();
5. p.doStuff(x);
6. System.out.print(" main x = " + x);
7. }
8.
9. void doStuff(int x) {
10. System.out.print(" doStuff x = " + x++);
11. }
12. }
What is the result?
: 결과는 무엇인가?
A. Compilation fails.
B. An exception is thrown at runtime.
C. doStuff x = 6 main x = 6
D. doStuff x = 5 main x = 5
E. doStuff x = 5 main x = 6
F. doStuff x = 6 main x = 5
Answer: D
QUESTION 50
Given:
1. interface Animal { void makeNoise(); }
2. class Horse implements Animal {
3. Long weight = 1200L;
4. public void makeNoise() { System.out.println("whinny"); }
5. }
6.
7. public class Icelandic extends Horse {
8. public void makeNoise() { System.out.println("vinny"); }
9. public static void main(String[] args) {
10. Icelandic i1 = new Icelandic();
11. Icelandic i2 = new Icelandic();
12. Icelandic i3 = new Icelandic();
13. i3 = i1; i1 = i2; i2 = null; i3 = i1;
14. }
15. }
When line 14 is reached, how many objects are eligible for the garbage collector?
: 14라인에 도달하면, 얼마나 많은 개체가 garbage collector을 받는가?
A. 0
B. 1
C. 2
D. 3
E. 4
F. 6
Answer: E
QUESTION 51
Given two files: GrizzlyBear.java and Salmon.java
1. package animals.mammals;
2.
3. public class GrizzlyBear extends Bear {
4. void hunt() {
5. Salmon s = findSalmon();
6. s.consume();
7. }
8. }
1. package animals.fish;
2.
3. public class Salmon extends Fish {
4. public void consume() { /* do stuff */ }
5. }
If both classes are in the correct directories for their packages, and the Mammal class correctly defines the findSalmon() method, which change allows this code to compile?
: 두 클래스는 패키지에 대한 올바른 디렉토리에 있으며, Mammal 클래스는 올바르게 findSalmon() 메소드를 정의합니다,
어떤 변화가 이 코드를 컴파일 할 수 있나?
A. add import animals.mammals.*; at line 2 in Salmon.java
B. add import animals.fish.*; at line 2 in GrizzlyBear.java
C. add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.java
D. add import animals.mammals.GrizzlyBear.*; at line 2 in Salmon.java
Answer: B
QUESTION 52
Given:
String[] elements = { "for", "tea", "too" };
String first = (elements.length > 0) ? elements[0] : null;
What is the result?
: 결과는 무엇인가?
A. Compilation fails.
B. An exception is thrown at runtime.
C. The variable first is set to null.
D. The variable first is set to elements[0].
Answer: D
QUESTION 53
A company has a business application that provides its users with many different reports: receivables reports, payables reports, revenue projects, and so on. The company has just purchased some new, state-of-the-art, wireless printers, and a programmer has been assigned the task of enhancing all of the reports to use not only the company's old printers, but the new wireless printers as well. When the programmer starts looking into the application, the programmer discovers that because of the design of the application, it is necessary to make changes to each report to support the new printers.Which two design concepts most likely explain this situation? (Choose two.)
A. Inheritance
B. Low cohesion
C. Tight coupling
D. High cohesion
E. Loose coupling
F. Object immutability
Answer: BC
QUESTION 54
Given:
10. public class SuperCalc {
11. protected static int multiply(int a, int b) { return a * b;}
12. }
and:
20. public class SubCalc extends SuperCalc{
21. public static int multiply(int a, int b) {
22. int c = super.multiply(a, b);
23. return c;
24. }
25. }
and:
30. SubCalc sc = new SubCalc ();
31. System.out.println(sc.multiply(3,4));
32. System.out.println(SubCalc.multiply(2,2));
What is the result?
: 결과는 무엇인가?
A. 12
B. The code runs with no output.
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 21.
E. Compilation fails because of an error in line 22.
F. Compilation fails because of an error in line 31.
Answer: E
QUESTION 55
Given:
6. public class Threads2 implements Runnable {
7.
8. public void run() {
9. System.out.println("run.");
10. throw new RuntimeException("Problem");
11. }
12. public static void main(String[] args) {
13. Thread t = new Thread(new Threads2());
14. t.start();
15. System.out.println("End of method.");
16. }
17. }
Which two can be results? (Choose two.)
: 가능한 두 개의 결과는 무엇인가? (2개를 고르시오.)
A. java.lang.RuntimeException: Problem
B. run. java.lang.RuntimeException: Problem
C. End of method. java.lang.RuntimeException: Problem
D. End of method. run. java.lang.RuntimeException: Problem
E. run. java.lang.RuntimeException: Problem End of method.
Answer: DE
QUESTION 56
Which two classes correctly implement both the java.lang.Runnable and the java.lang.
Cloneable interfaces? (Choose two.)
A. public class Session implements Runnable, Cloneable {
public void run();
public Object clone();
}
B. public class Session extends Runnable, Cloneable {
public void run() { /* do something */ }
public Object clone() { /* make a copy */ }
}
C. public class Session implements Runnable, Cloneable {
public void run() { /* do something */ }
public Object clone() { /* make a copy */ }
}
D. public abstract class Session implements Runnable, Cloneable {
public void run() { /* do something */ }
public Object clone() { /*make a copy */ }
}
E. public class Session implements Runnable, implements Cloneable {
public void run() { /* do something */ }
public Object clone() { /* make a copy */ }
}
Answer: CD
QUESTION 57
Given:
class Foo {
public int a = 3;
public void addFive() { a += 5; System.out.print("f "); }
}
class Bar extends Foo {
public int a = 8;
public void addFive() { this.a += 5; System.out.print("b " ); }
}
Invoked with:
Foo f = new Bar();
f.addFive();
System.out.println(f.a);
What is the result?
: 결과는 무엇인가?
A. b 3
B. b 8
C. b 13
D. f 3
E. f 8
F. f 13
G. Compilation fails.
H. An exception is thrown at runtime.
Answer: A
QUESTION 58
Given:
import java.util.TreeSet;
public class Explorer2 {
public static void main(String[] args) {
TreeSet<Integer> s = new TreeSet<Integer>();
TreeSet<Integer> subs = new TreeSet<Integer>();
for(int i = 606; i < 613; i++)
if(i%2 == 0) s.add(i);
subs = (TreeSet)s.subSet(608, true, 611, true);
s.add(629);
System.out.println(s + " " + subs);
}
}
What is the result?
: 결과는 무엇인가?
A. Compilation fails.
B. An exception is thrown at runtime.
C. [608, 610, 612, 629] [608, 610]
D. [608, 610, 612, 629] [608, 610, 629]
E. [606, 608, 610, 612, 629] [608, 610]
F. [606, 608, 610, 612, 629] [608, 610, 629]
Answer: E
QUESTION 59
Given:
11. //insert code here
12. private N min, max;
13. public N getMin() { return min; }
14. public N getMax() { return max; }
15. public void add(N added) {
16. if (min == null || added.doubleValue() < min.doubleValue())
17. min = added;
18. if (max == null || added.doubleValue() > max.doubleValue())
19. max = added;
20. }
21. }
Which two, inserted at line 11, will allow the code to compile? (Choose two.)
:
A. public class MinMax<?> {
B. public class MinMax<? extends Number> {
C. public class MinMax<N extends Object> {
D. public class MinMax<N extends Number> {
E. public class MinMax<? extends Object> {
F. public class MinMax<N extends Integer> {
Answer: DF
이해가 안되는 문제가 있다면 글 남겨주세요. 저도 JAVA 공부하면서 같이 해결해요~
Today.
I'd like to leave my child here.
: 우리 아이를 맡기고 싶어요.
How old is he?
: 몇 살이에요?
2016년 8월 14일 일요일
2016년 8월 13일 토요일
OCJP - 1Z0-851(A-2) 공부하자!
Name : OCJP Study
Category : Software
Purpose : JAVA 공부하면서 OCJP 가 합격이 되도록 비나이다.
compatibility : ...
Etc : eclipse
공부한 거는 Post 하자.!!!
JAVA도 공부하면서 OCJP 도 한번에 합격하시기를...
지금 이글을 읽을 정도로 자신의 시간을 투자하는 사람이라면 합격은 당연한것인가. 흠.
그럼 시작.
QUESTION 21 Given:
21. class Money {
22. private String country = "Canada";
23. public String getC() { return country; }
24. }
25. class Yen extends Money {
26. public String getC() { return super.country; }
27. }
28. public class Euro extends Money {
29. public String getC(int x) { return super.getC(); }
30. public static void main(String[] args) {
31. System.out.print(new Yen().getC() + " " + new Euro().getC());
32. }
33. }
What is the result?
: 결과는 무엇인가?
A. Canada
B. null Canada
C. Canada null
D. Canada Canada
E. Compilation fails due to an error on line 26.
F. Compilation fails due to an error on line 29.
Answer: E
QUESTION 22
Assuming that the serializeBanana() and the deserializeBanana() methods will correctly use Java serialization and given:
: serializeBanana() 와 deserializeBanana() 메소드가 제대로 자바 직렬화를 사용한다고 가정.
13. import java.io.*;
14. class Food implements Serializable {int good = 3;}
15. class Fruit extends Food {int juice = 5;}
16. public class Banana extends Fruit {
17. int yellow = 4;
18. public static void main(String [] args) {
19. Banana b = new Banana(); Banana b2 = new Banana();
20. b.serializeBanana(b); // assume correct serialization
21. b2 = b.deserializeBanana(); // assume correct
22. System.out.println("restore "+b2.yellow+ b2.juice+b2.good);
24. }
25. // more Banana methods go here
50. }
What is the result?
: 결과는 무엇인가?
A. restore 400
B. restore 403
C. restore 453
D. Compilation fails.
E. An exception is thrown at runtime.
Answer: C
QUESTION 23
Given a valid DateFormat object named df, and
: df라는 이름이 유효한 날짜 형식 개체가 주어지고,
16. Date d = new Date(0L);
17. String ds = "December 15, 2004";
18. //insert code here
What updates d's value with the date represented by ds?
: ds가 나타내는 날짜와 d의 값을 업데이트하는 것은 무엇인가?
A. 18. d = df.parse(ds);
B. 18. d = df.getDate(ds);
C. 18. try {
19. d = df.parse(ds);
20. } catch(ParseException e) { };
D. 18. try {
19. d = df.getDate(ds);
20. } catch(ParseException e) { };
Answer: C
QUESTION 24
Given:
11. double input = 314159.26;
12. NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN);
13. String b;
14. //insert code here
Which code, inserted at line 14, sets the value of b to 314.159,26?
: 14라인에 삽입하여 b의 값이 314.159,26으로 설정되는 것은 어느 코드인가?
A. b = nf.parse( input );
B. b = nf.format( input );
C. b = nf.equals( input );
D. b = nf.parseObject( input );
Answer: B
QUESTION 25
Given:
1. public class TestString1 {
2. public static void main(String[] args) {
3. String str = "420";
4. str += 42;
5. System.out.print(str);
6. }
7. }
What is the output?
: 무엇이 출력되는가?
A. 42
B. 420
C. 462
D. 42042
E. Compilation fails.
F. An exception is thrown at runtime.
Answer: D
QUESTION 26
Which capability exists only in java.io.FileWriter?
: java.io.FileWriter 에만 존재하는 기능은 어느 것인가?
A. Closing an open stream.
B. Flushing an open stream.
C. Writing to an open stream.
D. Writing a line separator to an open stream.
: 열린 스트림에 행 분리를 작성
Answer: D
QUESTION 27
Given that the current directory is empty, and that the user has read and write permissions, and the following:
1. import java.io.*;
2. public class DOS {
3. public static void main(String[] args) {
4. File dir = new File("dir");
5. dir.mkdir();
6. File f1 = new File(dir, "f1.txt");
7. try {
8. f1.createNewFile();
9. } catch (IOException e) { ; }
10. File newDir = new File("newDir");
11. dir.renameTo(newDir);
12. }
13. }
Which statement is true?
: 어떤 문장이 사실인가?
A. Compilation fails.
B. The file system has a new empty directory named dir.
C. The file system has a new empty directory named newDir.
D. The file system has a directory named dir, containing a file f1.txt.
E. The file system has a directory named newDir, containing a file f1.txt.
Answer: E
QUESTION 28 Given:
1. public class Score implements Comparable<Score> {
2. private int wins, losses;
3. public Score(int w, int l) { wins = w; losses = l; }
4. public int getWins() { return wins; }
5. public int getLosses() { return losses; }
6. public String toString() {
7. return "<" + wins + "," + losses + ">";
8. }
9. // insert code here
10. }
Which method will complete this class?
: 어느 메소드가 클래스를 완료할 것인가?
A. public int compareTo(Object o){/*more code here*/}
B. public int compareTo(Score other){/*more code here*/}
C. public int compare(Score s1,Score s2){/*more code here*/}
D. public int compare(Object o1,Object o2){/*more code here*/}
Answer: B
QUESTION 29
Given:
22. StringBuilder sb1 = new StringBuilder("123");
23. String s1 = "123";
24. // insert code here
25. System.out.println(sb1 + " " + s1);
Which code fragment, inserted at line 24, outputs 123abc 123abc?
: 24라인에 삽입하여 123abc 123abc 출력물이 나오는 코드 조각은 어느 것인가?
A. sb1.append("abc"); s1.append("abc");
B. sb1.append("abc"); s1.concat("abc");
C. sb1.concat("abc"); s1.append("abc");
D. sb1.concat("abc"); s1.concat("abc");
E. sb1.append("abc"); s1 = s1.concat("abc");
F. sb1.concat("abc"); s1 = s1.concat("abc");
G. sb1.append("abc"); s1 = s1 + s1.concat("abc");
H. sb1.concat("abc"); s1 = s1 + s1.concat("abc");
Answer: E
QUESTION 30
Click the Exhibit button.
Which code, inserted at line 14, will allow this class to correctly serialize and deserialize?
: 14라인에 삽입하여 이 클래스가 serialize 와 deserialize를 올바르게 허용하는 코드는 어느 것인가?
1. import java.io.*;
2. public class Foo implements Serializable {
3. public int x, y;
4. public Foo(int x, int y){
5. this.x = x; this.y = y;
6. }
7.
8. private void writeObject(ObjectOutputStream s)
9. throws IOException{
10. s.writeInt(x); s.writeInt(y);
11. }
12.
13. private void readObject(ObjectInputStream s)
14. throws IOException, ClassNotFoundException {
15. //insert code here
16. }
17. }
A. s.defaultReadObject();
B. this = s.defaultReadObject();
C. y = s.readInt(); x = s.readInt();
D. x = s.readInt(); y = s.readInt();
Answer: D
QUESTION 31
Given:
interface Foo {}
class Alpha implements Foo {}
class Beta extends Alpha {}
class Delta extends Beta {
public static void main( String[] args ) {
Beta x = new Beta();
16. //insert code here
}
}
Which code, inserted at line 16, will cause a java.lang.ClassCastException?
A. Alpha a = x;
B. Foo f = (Delta)x;
C. Foo f = (Alpha)x;
D. Beta b = (Beta)(Alpha)x;
Answer: B
QUESTION 32
Given:
public void go() {
String o = "";
z:
for(int x = 0; x < 3; x++) {
for(int y = 0; y < 2; y++) {
if(x==1) break;
if(x==2 && y==1) break z;
o = o + x + y;
}
}
System.out.println(o);
}
What is the result when the go() method is invoked?
: go() 메소드를 호출하였을 때, 결과는 무엇인가?
A. 00
B. 0001
C. 000120
D. 00012021
E. Compilation fails.
F. An exception is thrown at runtime.
Answer: C
QUESTION 33
Given:
33. try {
34. //some code here
35. } catch (NullPointerException e1) {
36. System.out.print("a");
37. } catch (Exception e2) {
38. System.out.print("b");
39. } finally {
40. System.out.print("c");
41. }
If some sort of exception is thrown at line 34, which output is possible?
: 만약 예외의 어떤 종류가 34라인에서 발생한다면, 어느 출력물이 가능한가?
A. a
B. b
C. c
D. ac
E. abc
Answer: D
QUESTION 34
Given:
31. //some code here
32. try {
33. //some code here
34. } catch (NullPointerException e1) {
35. //some code here
36. } finally {
37. //some code here
38. }
Under which three circumstances will the code on line 37 be executed? (Choose three.)
: 아래 3가지 상황 중 37라인의 코드가 실행되도록 하는 것은?
A. The instance gets garbage collected.
B. The code on line 33 throws an exception.
C. The code on line 35 throws an exception.
D. The code on line 31 throws an exception.
E. The code on line 33 executes successfully.
Answer: BCE
QUESTION 35
Given:
public class Donkey {
public static void main(String[] args) {
boolean assertsOn = true;
assert (assertsOn) : assertsOn = true;
if(assertsOn) {
System.out.println("assert is on");
}
}
}
If class Donkey is invoked twice, the first time without assertions enabled, and the second time with assertions enabled, what are the results?
: Donkey 클래스가 두번 호출된다면, 처음에는 assertions를 사용하지 않고, 두번째에는 assertions를 사용한다면, 결과는 무엇인가?
A. no output
B. no output assert is on
C. assert is on
D. no output An AssertionError is thrown.
E. assert is on An AssertionError is thrown.
Answer: C
QUESTION 36
Given:
public void method() {
A a = new A();
a.method1();
}
Which statement is true if a TestException is thrown on line 3 of class B?
: TestException가 B 클래스의 3라인에서 발생하는 경우 어떤 문장이 사실인가?
1. public class A{
2. public void method1() {
3. try {
4. B b = new B();
5. b.method2();
6. //more code here
7. } catch (TestException te){
8. throw new RuntimeException(te);
9. }
10. }
11. }
1. public class B{
2. public void method2() throws TestException {
3. //more code here
4. }
5. }
1. class TestException extends Exception {
2. }
A. Line 33 must be called within a try block.
B. The exception thrown by method1 in class A is not required to be caught.
C. The method declared on line 31 must be declared to throw a RuntimeException.
D. On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.
Answer: B
QUESTION 37
Given:
01. Float pi = new Float(3.14f);
02. if (pi > 3) {
03. System.out.print("pi is bigger than 3. ");
04. }
05. else {
06. System.out.print("pi is not bigger than 3. ");
07. }
08. finally {
09. System.out.println("Have a nice day.");
10. }
What is the result?
: 결과는 무엇인가?
A. Compilation fails.
B. pi is bigger than 3.
C. An exception occurs at runtime.
D. pi is bigger than 3. Have a nice day.
E. pi is not bigger than 3. Have a nice day.
Answer: A
QUESTION 38
Given:
1. public class Boxer1{
2. Integer i;
3. int x;
4. public Boxer1(int y) {
5. x = i+y;
6. System.out.println(x);
7. }
8. public static void main(String[] args) {
9. new Boxer1(new Integer(4));
10. }
11. }
What is the result?
: 결과는 무엇인가?
A. The value 4 is printed at the command line.
B. Compilation fails because of an error in line 5.
C. Compilation fails because of an error in line 9.
D. A NullPointerException occurs at runtime.
E. A NumberFormatException occurs at runtime.
F. An IllegalStateException occurs at runtime.
Answer: D
QUESTION 39
Given:
1. public class Person {
2. private String name;
3. public Person(String name) { this.name = name; }
4. public boolean equals(Person p) {
5. return p.name.equals(this.name);
6. }
7. }
Which statement is true?
A. The equals method does NOT properly override the Object.equals method.
: equals method는 Object.equals 메소드를 정확하게 오버라이드하지 않는다.
B. Compilation fails because the private attribute p.name cannot be accessed in line 5.
C. To work correctly with hash-based data structures, this class must also implement the hashCode method. D. When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.
Answer: A
QUESTION 40
Which two statements are true about the hashCode method? (Choose two.)
: hashCode 메소드에 대한 사실인 두 문장은 어느 것인가? (두개 고르시오.)
A. The hashCode method for a given class can be used to test for object equality and object inequality for that class.
: 주어진 클래스의 hashCode 메소드는 해당 클래스의 객체 평등과 개체 불평등을 테스트하는 데 사용할 수 있습니다.
B. The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
: hashCode 메소드는 세트 내의 요소를 명령하는 java.util.SortedSet 컬렉션 클래스에 의해 사용된다.
C. The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.
: 주어진 클래스의 hashCode 메소드는 객체 불평등을 테스트하는 데 사용할 수 있지만, 객체 평등은 클래스에서 하지 못한다.
D. The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
: 해시 코드 메소드에 의해 반환되는 값의 유일한 중요한 특징은 값의 분포가 가우시안 분포를 수행해야한다는 것입니다.
E. The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.
: hashCode 메소드는 빠른 검색을 위해 해시 버킷에 그룹으로는 java.util.HashSet 컬렉션 클래스에 의해 해당 세트 내의 요소를 사용합니다.
Answer: CE
이해가 안되는 문제가 있다면 글 남겨주세요. 저도 JAVA 공부하면서 같이 해결해요~
Today.
What are the tourist attractions in this city?
: 이 도시의 관광 명소에는 어떤 것이 있어요?
You should go to Disneyland.
: 디즈니랜드는 꼭 가 보세요.
Category : Software
Purpose : JAVA 공부하면서 OCJP 가 합격이 되도록 비나이다.
compatibility : ...
Etc : eclipse
공부한 거는 Post 하자.!!!
JAVA도 공부하면서 OCJP 도 한번에 합격하시기를...
지금 이글을 읽을 정도로 자신의 시간을 투자하는 사람이라면 합격은 당연한것인가. 흠.
그럼 시작.
QUESTION 21 Given:
21. class Money {
22. private String country = "Canada";
23. public String getC() { return country; }
24. }
25. class Yen extends Money {
26. public String getC() { return super.country; }
27. }
28. public class Euro extends Money {
29. public String getC(int x) { return super.getC(); }
30. public static void main(String[] args) {
31. System.out.print(new Yen().getC() + " " + new Euro().getC());
32. }
33. }
What is the result?
: 결과는 무엇인가?
A. Canada
B. null Canada
C. Canada null
D. Canada Canada
E. Compilation fails due to an error on line 26.
F. Compilation fails due to an error on line 29.
Answer: E
QUESTION 22
Assuming that the serializeBanana() and the deserializeBanana() methods will correctly use Java serialization and given:
: serializeBanana() 와 deserializeBanana() 메소드가 제대로 자바 직렬화를 사용한다고 가정.
13. import java.io.*;
14. class Food implements Serializable {int good = 3;}
15. class Fruit extends Food {int juice = 5;}
16. public class Banana extends Fruit {
17. int yellow = 4;
18. public static void main(String [] args) {
19. Banana b = new Banana(); Banana b2 = new Banana();
20. b.serializeBanana(b); // assume correct serialization
21. b2 = b.deserializeBanana(); // assume correct
22. System.out.println("restore "+b2.yellow+ b2.juice+b2.good);
24. }
25. // more Banana methods go here
50. }
What is the result?
: 결과는 무엇인가?
A. restore 400
B. restore 403
C. restore 453
D. Compilation fails.
E. An exception is thrown at runtime.
Answer: C
QUESTION 23
Given a valid DateFormat object named df, and
: df라는 이름이 유효한 날짜 형식 개체가 주어지고,
16. Date d = new Date(0L);
17. String ds = "December 15, 2004";
18. //insert code here
What updates d's value with the date represented by ds?
: ds가 나타내는 날짜와 d의 값을 업데이트하는 것은 무엇인가?
A. 18. d = df.parse(ds);
B. 18. d = df.getDate(ds);
C. 18. try {
19. d = df.parse(ds);
20. } catch(ParseException e) { };
D. 18. try {
19. d = df.getDate(ds);
20. } catch(ParseException e) { };
Answer: C
QUESTION 24
Given:
11. double input = 314159.26;
12. NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN);
13. String b;
14. //insert code here
Which code, inserted at line 14, sets the value of b to 314.159,26?
: 14라인에 삽입하여 b의 값이 314.159,26으로 설정되는 것은 어느 코드인가?
A. b = nf.parse( input );
B. b = nf.format( input );
C. b = nf.equals( input );
D. b = nf.parseObject( input );
Answer: B
QUESTION 25
Given:
1. public class TestString1 {
2. public static void main(String[] args) {
3. String str = "420";
4. str += 42;
5. System.out.print(str);
6. }
7. }
What is the output?
: 무엇이 출력되는가?
A. 42
B. 420
C. 462
D. 42042
E. Compilation fails.
F. An exception is thrown at runtime.
Answer: D
QUESTION 26
Which capability exists only in java.io.FileWriter?
: java.io.FileWriter 에만 존재하는 기능은 어느 것인가?
A. Closing an open stream.
B. Flushing an open stream.
C. Writing to an open stream.
D. Writing a line separator to an open stream.
: 열린 스트림에 행 분리를 작성
Answer: D
QUESTION 27
Given that the current directory is empty, and that the user has read and write permissions, and the following:
1. import java.io.*;
2. public class DOS {
3. public static void main(String[] args) {
4. File dir = new File("dir");
5. dir.mkdir();
6. File f1 = new File(dir, "f1.txt");
7. try {
8. f1.createNewFile();
9. } catch (IOException e) { ; }
10. File newDir = new File("newDir");
11. dir.renameTo(newDir);
12. }
13. }
Which statement is true?
: 어떤 문장이 사실인가?
A. Compilation fails.
B. The file system has a new empty directory named dir.
C. The file system has a new empty directory named newDir.
D. The file system has a directory named dir, containing a file f1.txt.
E. The file system has a directory named newDir, containing a file f1.txt.
Answer: E
QUESTION 28 Given:
1. public class Score implements Comparable<Score> {
2. private int wins, losses;
3. public Score(int w, int l) { wins = w; losses = l; }
4. public int getWins() { return wins; }
5. public int getLosses() { return losses; }
6. public String toString() {
7. return "<" + wins + "," + losses + ">";
8. }
9. // insert code here
10. }
Which method will complete this class?
: 어느 메소드가 클래스를 완료할 것인가?
A. public int compareTo(Object o){/*more code here*/}
B. public int compareTo(Score other){/*more code here*/}
C. public int compare(Score s1,Score s2){/*more code here*/}
D. public int compare(Object o1,Object o2){/*more code here*/}
Answer: B
QUESTION 29
Given:
22. StringBuilder sb1 = new StringBuilder("123");
23. String s1 = "123";
24. // insert code here
25. System.out.println(sb1 + " " + s1);
Which code fragment, inserted at line 24, outputs 123abc 123abc?
: 24라인에 삽입하여 123abc 123abc 출력물이 나오는 코드 조각은 어느 것인가?
A. sb1.append("abc"); s1.append("abc");
B. sb1.append("abc"); s1.concat("abc");
C. sb1.concat("abc"); s1.append("abc");
D. sb1.concat("abc"); s1.concat("abc");
E. sb1.append("abc"); s1 = s1.concat("abc");
F. sb1.concat("abc"); s1 = s1.concat("abc");
G. sb1.append("abc"); s1 = s1 + s1.concat("abc");
H. sb1.concat("abc"); s1 = s1 + s1.concat("abc");
Answer: E
QUESTION 30
Click the Exhibit button.
Which code, inserted at line 14, will allow this class to correctly serialize and deserialize?
: 14라인에 삽입하여 이 클래스가 serialize 와 deserialize를 올바르게 허용하는 코드는 어느 것인가?
1. import java.io.*;
2. public class Foo implements Serializable {
3. public int x, y;
4. public Foo(int x, int y){
5. this.x = x; this.y = y;
6. }
7.
8. private void writeObject(ObjectOutputStream s)
9. throws IOException{
10. s.writeInt(x); s.writeInt(y);
11. }
12.
13. private void readObject(ObjectInputStream s)
14. throws IOException, ClassNotFoundException {
15. //insert code here
16. }
17. }
A. s.defaultReadObject();
B. this = s.defaultReadObject();
C. y = s.readInt(); x = s.readInt();
D. x = s.readInt(); y = s.readInt();
Answer: D
QUESTION 31
Given:
interface Foo {}
class Alpha implements Foo {}
class Beta extends Alpha {}
class Delta extends Beta {
public static void main( String[] args ) {
Beta x = new Beta();
16. //insert code here
}
}
Which code, inserted at line 16, will cause a java.lang.ClassCastException?
A. Alpha a = x;
B. Foo f = (Delta)x;
C. Foo f = (Alpha)x;
D. Beta b = (Beta)(Alpha)x;
Answer: B
QUESTION 32
Given:
public void go() {
String o = "";
z:
for(int x = 0; x < 3; x++) {
for(int y = 0; y < 2; y++) {
if(x==1) break;
if(x==2 && y==1) break z;
o = o + x + y;
}
}
System.out.println(o);
}
What is the result when the go() method is invoked?
: go() 메소드를 호출하였을 때, 결과는 무엇인가?
A. 00
B. 0001
C. 000120
D. 00012021
E. Compilation fails.
F. An exception is thrown at runtime.
Answer: C
QUESTION 33
Given:
33. try {
34. //some code here
35. } catch (NullPointerException e1) {
36. System.out.print("a");
37. } catch (Exception e2) {
38. System.out.print("b");
39. } finally {
40. System.out.print("c");
41. }
If some sort of exception is thrown at line 34, which output is possible?
: 만약 예외의 어떤 종류가 34라인에서 발생한다면, 어느 출력물이 가능한가?
A. a
B. b
C. c
D. ac
E. abc
Answer: D
QUESTION 34
Given:
31. //some code here
32. try {
33. //some code here
34. } catch (NullPointerException e1) {
35. //some code here
36. } finally {
37. //some code here
38. }
Under which three circumstances will the code on line 37 be executed? (Choose three.)
: 아래 3가지 상황 중 37라인의 코드가 실행되도록 하는 것은?
A. The instance gets garbage collected.
B. The code on line 33 throws an exception.
C. The code on line 35 throws an exception.
D. The code on line 31 throws an exception.
E. The code on line 33 executes successfully.
Answer: BCE
QUESTION 35
Given:
public class Donkey {
public static void main(String[] args) {
boolean assertsOn = true;
assert (assertsOn) : assertsOn = true;
if(assertsOn) {
System.out.println("assert is on");
}
}
}
If class Donkey is invoked twice, the first time without assertions enabled, and the second time with assertions enabled, what are the results?
: Donkey 클래스가 두번 호출된다면, 처음에는 assertions를 사용하지 않고, 두번째에는 assertions를 사용한다면, 결과는 무엇인가?
A. no output
B. no output assert is on
C. assert is on
D. no output An AssertionError is thrown.
E. assert is on An AssertionError is thrown.
Answer: C
QUESTION 36
Given:
public void method() {
A a = new A();
a.method1();
}
Which statement is true if a TestException is thrown on line 3 of class B?
: TestException가 B 클래스의 3라인에서 발생하는 경우 어떤 문장이 사실인가?
1. public class A{
2. public void method1() {
3. try {
4. B b = new B();
5. b.method2();
6. //more code here
7. } catch (TestException te){
8. throw new RuntimeException(te);
9. }
10. }
11. }
1. public class B{
2. public void method2() throws TestException {
3. //more code here
4. }
5. }
1. class TestException extends Exception {
2. }
A. Line 33 must be called within a try block.
B. The exception thrown by method1 in class A is not required to be caught.
C. The method declared on line 31 must be declared to throw a RuntimeException.
D. On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.
Answer: B
QUESTION 37
Given:
01. Float pi = new Float(3.14f);
02. if (pi > 3) {
03. System.out.print("pi is bigger than 3. ");
04. }
05. else {
06. System.out.print("pi is not bigger than 3. ");
07. }
08. finally {
09. System.out.println("Have a nice day.");
10. }
What is the result?
: 결과는 무엇인가?
A. Compilation fails.
B. pi is bigger than 3.
C. An exception occurs at runtime.
D. pi is bigger than 3. Have a nice day.
E. pi is not bigger than 3. Have a nice day.
Answer: A
QUESTION 38
Given:
1. public class Boxer1{
2. Integer i;
3. int x;
4. public Boxer1(int y) {
5. x = i+y;
6. System.out.println(x);
7. }
8. public static void main(String[] args) {
9. new Boxer1(new Integer(4));
10. }
11. }
What is the result?
: 결과는 무엇인가?
A. The value 4 is printed at the command line.
B. Compilation fails because of an error in line 5.
C. Compilation fails because of an error in line 9.
D. A NullPointerException occurs at runtime.
E. A NumberFormatException occurs at runtime.
F. An IllegalStateException occurs at runtime.
Answer: D
QUESTION 39
Given:
1. public class Person {
2. private String name;
3. public Person(String name) { this.name = name; }
4. public boolean equals(Person p) {
5. return p.name.equals(this.name);
6. }
7. }
Which statement is true?
A. The equals method does NOT properly override the Object.equals method.
: equals method는 Object.equals 메소드를 정확하게 오버라이드하지 않는다.
B. Compilation fails because the private attribute p.name cannot be accessed in line 5.
C. To work correctly with hash-based data structures, this class must also implement the hashCode method. D. When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.
Answer: A
QUESTION 40
Which two statements are true about the hashCode method? (Choose two.)
: hashCode 메소드에 대한 사실인 두 문장은 어느 것인가? (두개 고르시오.)
A. The hashCode method for a given class can be used to test for object equality and object inequality for that class.
: 주어진 클래스의 hashCode 메소드는 해당 클래스의 객체 평등과 개체 불평등을 테스트하는 데 사용할 수 있습니다.
B. The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
: hashCode 메소드는 세트 내의 요소를 명령하는 java.util.SortedSet 컬렉션 클래스에 의해 사용된다.
C. The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.
: 주어진 클래스의 hashCode 메소드는 객체 불평등을 테스트하는 데 사용할 수 있지만, 객체 평등은 클래스에서 하지 못한다.
D. The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
: 해시 코드 메소드에 의해 반환되는 값의 유일한 중요한 특징은 값의 분포가 가우시안 분포를 수행해야한다는 것입니다.
E. The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.
: hashCode 메소드는 빠른 검색을 위해 해시 버킷에 그룹으로는 java.util.HashSet 컬렉션 클래스에 의해 해당 세트 내의 요소를 사용합니다.
Answer: CE
이해가 안되는 문제가 있다면 글 남겨주세요. 저도 JAVA 공부하면서 같이 해결해요~
Today.
What are the tourist attractions in this city?
: 이 도시의 관광 명소에는 어떤 것이 있어요?
You should go to Disneyland.
: 디즈니랜드는 꼭 가 보세요.
OCJP - 1Z0-851(A-1) 공부하자!
Name : OCJP Study
Category : Software
Purpose : JAVA 공부하면서 OCJP 가 합격이 되도록 비나이다.
compatibility : ...
Etc : eclipse
공부한 거는 Post 하자.!!!
JAVA도 공부하면서 OCJP 도 한번에 합격하시기를...
지금 이글을 읽을 정도로 자신의 시간을 투자하는 사람이라면 합격은 당연한것인가. 흠.
그럼 시작.
QUESTION 1
Which two statements are true? (Choose two.)
: 어느 두 문장이 사실인가? (2개를 고르시오.)
A. It is possible for more than two threads to deadlock at once.
: 두 개 이상의 스레드가 한번에 교착하는 것이 가능하다.
B. The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.
: JVM의 구현은 여러 스레드가 교착 상태에 들어갈 수 없음을 보장합니다.
C. Deadlocked threads release once their sleep() method's sleep duration has expired.
: sleep() 메소드의 sleep 시간이 만료되면 교착 상태 스레드를 풀어줍니다.
D. Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.
: 교착 상태는 wait(), notify(), otifyAll () 메소드를 잘못 사용하는 경우에만 발생할 수 있습니다.
E. It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.
: 동기 블록을 잘못 사용되는 경우 단일 스레드 애플리케이션이 교착하는 것이 가능하다.
F. If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().
: 코드 부분은 교착 할 경우 Thread.yield() 호출을 삽입함으로써 교착 가능성을 제거 할 수 없다.
Answer: AF
QUESTION 2 Given:
void waitForSignal() {
Object obj = new Object();
synchronized (Thread.currentThread()) {
obj.wait();
obj.notify();
}
}
Which statement is true?
: 어떤 것이 사실인가?
A. This code can throw an InterruptedException.
B. This code can throw an IllegalMonitorStateException.
C. This code can throw a TimeoutException after ten minutes.
D. Reversing the order of obj.wait() and obj.notify() might cause this method to complete normally.
E. A call to notify() or notifyAll() from another thread might cause this method to complete normally.
F. This code does NOT compile unless obj.wait() is replaced with ((Thread) obj).wait().
Answer: A
QUESTION 3
What is the output if the main() method is run?
: main() 메소드가 실행되는 경우 무엇이 출력됩니까?
1. public class Starter extends Thread {
2. private int x = 2;
3. public static void main(String[] args) throws Exception {
4. new Starter().makeItSo();
5. }
6. public Starter(){
7. x = 5;
8. start();
9. }
10. public void makeItSo() throws Exception {
11. join();
12. x = x - 1;
13. System.out.println(x);
14. }
15. public void run() { x *= 2; }
16. }
A. 4
B. 5
C. 8
D. 9
E. Compilation fails.
F. An exception is thrown at runtime.
G. It is impossible to determine for certain.
Answer: D
: join() 공부
Waits for this thread to die.
: 이러한 맥락에서 죽을 때까지 기다립니다.
An invocation of this method behaves in exactly the same way as the invocation
: 이 메서드의 호출이 호출과 정확히 동일한 방식으로 행동한다.
QUESTION 4 Given:
1. class PingPong2 {
2. synchronized void hit(long n) {
3. for(int i = 1; i < 3; i++)
4. System.out.print(n + "-" + i + " ");
5. }
6. }
1. public class Tester implements Runnable {
2. static PingPong2 pp2 = new PingPong2();
3. public static void main(String[] args) {
4. new Thread(new Tester()).start();
5. new Thread(new Tester()).start();
6. }
7. public void run() { pp2.hit(Thread.currentThread().getId()); }
8. }
Which statement is true?
: 옳은 설명은?
A. The output could be 5-1 6-1 6-2 5-2
B. The output could be 6-1 6-2 5-1 5-2
C. The output could be 6-1 5-2 6-2 5-1
D. The output could be 6-1 6-2 5-1 7-1
Answer: B
: synchronized 공부
QUESTION 5 Given:
1. public abstract class Shape {
2. private int x;
3. private int y;
4. public abstract void draw();
5. public void setAnchor(int x, int y) {
6. this.x = x;
7. this.y = y;
8. }
9. }
Which two classes use the Shape class correctly? (Choose two.)
: Shape 클래스를 정확하게 사용한 두 개의 클래스는 어떤 것인가? (2개를 고르시오.)
A. public class Circle implements Shape { private int radius; }
B. public abstract class Circle extends Shape { private int radius; }
C. public class Circle extends Shape { private int radius; public void draw(); }
D. public abstract class Circle implements Shape { private int radius; public void draw(); }
E. public class Circle extends Shape { private int radius; public void draw() {/* code here */} } F. public abstract class Circle implements Shape { private int radius; public void draw() {/* code here */} }
Answer: BE
QUESTION 6 Given:
1. public class Barn {
2. public static void main(String[] args) {
3. new Barn().go("hi", 1);
4. new Barn().go("hi", "world", 2);
5. }
6. public void go(String... y, int x) {
7. System.out.print(y[y.length - 1] + " ");
8. }
9. }
What is the result?
: 결과는 무엇인가?
A. hi hi
B. hi world
C. world world
D. Compilation fails.
E. An exception is thrown at runtime.
Answer: D
: variable argument 공부
QUESTION 7 Given:
09. class Nav{
10. public enum Direction { NORTH, SOUTH, EAST, WEST }
11. }
12.
13. public class Sprite{
14. // insert code here
15. }
Which code, inserted at line 14, allows the Sprite class to compile?
: 14라인에 삽입되면, Sprite 클래스가 컴파일 될 수 있는 코드는 어느 것인가?
A. Direction d = NORTH;
B. Nav.Direction d = NORTH;
C. Direction d = Direction.NORTH;
D. Nav.Direction d = Nav.Direction.NORTH;
Answer: D
QUESTION 8
Which statement is true about the classes and interfaces?
: classes 와 interfaces 에 관련해서 사실인 것은?
1. public interface A {
2. public void doSomething(String thing);
3. }
1. public class AImpl implements A {
2. public void doSomething(String msg) {}
3. }
1. public class B {
2. public A doit(){
3. //more code here
4. }
5. public String execute(){
6. //more code here
7. }
8. }
1. public class C extends B {
2. public AImpl doit(){
3. //more code here
4. }
5.
6. public Object execute() {
7. //more code here
8. }
9. }
A. Compilation will succeed for all classes and interfaces.
B. Compilation of class C will fail because of an error in line 2.
C. Compilation of class C will fail because of an error in line 6.
D. Compilation of class AImpl will fail because of an error in line 2.
Answer: C
QUESTION 9
What is the result?
: 결과는 무엇인가?
11. public class Person {
12. String name = "No name";
13. public Person(String nm) { name = nm; }
14. }
15.
16. public class Employee extends Person {
17. String empID = "0000";
18. public Employee(String id) { empID = id; }
19. }
20.
21. public class EmployeeTest {
22. public static void main(String[] args){
23. Employee e = new Employee("4321");
24. System.out.println(e.empID);
25. }
26. }
A. 4321
B. 0000
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 18.
Answer: D
: 상속 생성자 공부
QUESTION 10 Given:
1. public class Rainbow {
2. public enum MyColor {
3. RED(0xff0000), GREEN(0x00ff00), BLUE(0x0000ff);
4. private final int rgb;
5. MyColor(int rgb) { this.rgb = rgb; }
6. public int getRGB() { return rgb; }
7. };
8. public static void main(String[] args) {
9. //insert code here
10. }
11. }
Which code fragment, inserted at line 19, allows the Rainbow class to compile?
: 19라인에 삽입되면, Rainbow 클래스가 컴파일 될 수 있는 코드 조각은 어느 것인가?
A. MyColor skyColor = BLUE;
B. MyColor treeColor = MyColor.GREEN;
C. if(RED.getRGB() < BLUE.getRGB()) { }
D. Compilation fails due to other error(s) in the code.
E. MyColor purple = new MyColor(0xff00ff);
F. MyColor purple = MyColor.BLUE + MyColor.RED;
Answer: B
QUESTION 11 Given:
1. class Atom {
2. Atom() { System.out.print("atom "); }
3. }
4. class Rock extends Atom {
5. Rock(String type) { System.out.print(type); }
6. }
7. public class Mountain extends Rock {
8. Mountain() {
9. super("granite ");
10. new Rock("granite ");
11. }
12. public static void main(String[] a) { new Mountain(); }
13. }
What is the result?
: 결과는 무엇인가?
A. Compilation fails.
B. atom granite
C. granite granite
D. atom granite granite
E. An exception is thrown at runtime.
F. atom granite atom granite
Answer: F
QUESTION 12
Given:
01. interface TestA { String toString(); }
02.
03. public class Test {
04. public static void main(String[] args) {
05. System.out.println(new TestA() {
06. public String toString() { return "test"; }
07. });
08. }
09. }
What is the result?
: 결과는 무엇인가?
A. test
B. null
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 1.
E. Compilation fails because of an error in line 4.
F. Compilation fails because of an error in line 5.
Answer: A
QUESTION 13
Given:
1. public static void parse(String str) {
2. try {
3. float f = Float.parseFloat(str);
4. } catch (NumberFormatException nfe) {
5. f = 0;
6. } finally {
7. System.out.println(f);
8. }
9. }
10. public static void main(String[] args) {
11. parse("invalid");
12. }
What is the result?
: 결과는 무엇인가?
A. 0.0
B. Compilation fails.
C. A ParseException is thrown by the parse method at runtime.
D. A NumberFormatException is thrown by the parse method at runtime.
Answer: B
QUESTION 14
Given:
1. public class Blip {
2. protected int blipvert(int x) { return 0; }
3. }
4. class Vert extends Blip {
5. // insert code here
6. }
Which five methods, inserted independently at line 5, will compile? (Choose five.)
: 5줄에 독립적으로 삽입 되어 컴파일이 되는 다섯 메소트는 어느 것인가? (5개 고르시오.)
A. public int blipvert(int x) { return 0; }
B. private int blipvert(int x) { return 0; }
C. private int blipvert(long x) { return 0; }
D. protected long blipvert(int x) { return 0; }
E. protected int blipvert(long x) { return 0; }
F. protected long blipvert(long x) { return 0; }
G. protected long blipvert(int x, int y) { return 0; }
Answer: ACEFG
QUESTION 15
Given:
1. class Super {
2. private int a;
3. protected Super(int a) { this.a = a; }
4. }
11. class Sub extends Super {
12. public Sub(int a) { super(a); }
13. public Sub() { this.a = 5; }
14. }
Which two, independently, will allow Sub to compile? (Choose two.)
: 독립적으로 Sub 클래스가 컴파일 되도록 하는 2개는 어느 것인가? (2개를 고르시오.)
A. Change line 2 to: public int a;
B. Change line 2 to: protected int a;
C. Change line 13 to: public Sub() { this(5); }
D. Change line 13 to: public Sub() { super(5); }
E. Change line 13 to: public Sub() { super(a); }
Answer: CD
QUESTION 16
Which Man class properly represents the relationship "Man has a best friend who is a Dog"?
: Man 클래스가 "Man has a best friend who is a Dog" 관계로 제대로 표현된 것은 어느 것인가?
A. class Man extends Dog { }
B. class Man implements Dog { }
C. class Man { private BestFriend dog; }
D. class Man { private Dog bestFriend; }
E. class Man { private Dog<bestFriend>; }
F. class Man { private BestFriend<dog>; }
Answer: D
QUESTION 17
Given:
1. package test;
2.
3. class Target {
4. public String name = "hello";
5. }
What can directly access and change the value of the variable name?
: 바로 접근할 수 있고, variable name 의 값을 변경할 수있는 것은 무엇인가?
A. any class
B. only the Target class
C. any class in the test package
D. any class that extends Target
Answer: C
QUESTION 18
Given:
11. abstract class Vehicle { public int speed() { return 0; }
12. class Car extends Vehicle { public int speed() { return 60; }
13. class RaceCar extends Car { public int speed() { return 150; } ...
21. RaceCar racer = new RaceCar();
22. Car car = new RaceCar();
23 Vehicle vehicle = new RaceCar();
24 System.out.println(racer.speed() + ", " + car.speed() + ", " + vehicle.speed());
What is the result?
: 결과는 무엇인가?
A. 0, 0, 0
B. 150, 60, 0
C. Compilation fails.
D. 150, 150, 150
E. An exception is thrown at runtime.
Answer: D
QUESTION 19
Given:
5. class Building { }
6. public class Barn extends Building {
7. public static void main(String[] args) {
8. Building build1 = new Building();
9. Barn barn1 = new Barn();
10. Barn barn2 = (Barn) build1;
11. Object obj1 = (Object) build1;
12. String str1 = (String) build1;
13. Building build2 = (Building) barn1;
14. }
15. }
Which is true?
: 사실인 것은?
A. If line 10 is removed, the compilation succeeds.
B. If line 11 is removed, the compilation succeeds.
C. If line 12 is removed, the compilation succeeds.
D. If line 13 is removed, the compilation succeeds.
E. More than one line must be removed for compilation to succeed.
Answer: C
QUESTION 20
A team of programmers is reviewing a proposed API for a new utility class. After some discussion, they realize that they can reduce the number of methods in the API without losing any functionality. If they implement the new design, which two OO principles will they be promoting?
A. Looser coupling
: 느슨한 결합
B. Tighter coupling
: 강한 결합
C. Lower cohesion
: 낮은 응집력
D. Higher cohesion
: 강한 응집력
E. Weaker encapsulation
: 약한 캡슐화
F. Stronger encapsulation
: 강한 캡슐화
Answer: AD
이해가 안되는 문제가 있다면 글 남겨주세요. 저도 JAVA 공부하면서 같이 해결해요~
Today.
Is the fish fresh?
: 이 생선 싱싱해요?
Yes. It was delivered today.
: 네, 오늘 들어왔어요.
Category : Software
Purpose : JAVA 공부하면서 OCJP 가 합격이 되도록 비나이다.
compatibility : ...
Etc : eclipse
공부한 거는 Post 하자.!!!
JAVA도 공부하면서 OCJP 도 한번에 합격하시기를...
지금 이글을 읽을 정도로 자신의 시간을 투자하는 사람이라면 합격은 당연한것인가. 흠.
그럼 시작.
QUESTION 1
Which two statements are true? (Choose two.)
: 어느 두 문장이 사실인가? (2개를 고르시오.)
A. It is possible for more than two threads to deadlock at once.
: 두 개 이상의 스레드가 한번에 교착하는 것이 가능하다.
B. The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.
: JVM의 구현은 여러 스레드가 교착 상태에 들어갈 수 없음을 보장합니다.
C. Deadlocked threads release once their sleep() method's sleep duration has expired.
: sleep() 메소드의 sleep 시간이 만료되면 교착 상태 스레드를 풀어줍니다.
D. Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.
: 교착 상태는 wait(), notify(), otifyAll () 메소드를 잘못 사용하는 경우에만 발생할 수 있습니다.
E. It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.
: 동기 블록을 잘못 사용되는 경우 단일 스레드 애플리케이션이 교착하는 것이 가능하다.
F. If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().
: 코드 부분은 교착 할 경우 Thread.yield() 호출을 삽입함으로써 교착 가능성을 제거 할 수 없다.
Answer: AF
QUESTION 2 Given:
void waitForSignal() {
Object obj = new Object();
synchronized (Thread.currentThread()) {
obj.wait();
obj.notify();
}
}
Which statement is true?
: 어떤 것이 사실인가?
A. This code can throw an InterruptedException.
B. This code can throw an IllegalMonitorStateException.
C. This code can throw a TimeoutException after ten minutes.
D. Reversing the order of obj.wait() and obj.notify() might cause this method to complete normally.
E. A call to notify() or notifyAll() from another thread might cause this method to complete normally.
F. This code does NOT compile unless obj.wait() is replaced with ((Thread) obj).wait().
Answer: A
QUESTION 3
What is the output if the main() method is run?
: main() 메소드가 실행되는 경우 무엇이 출력됩니까?
1. public class Starter extends Thread {
2. private int x = 2;
3. public static void main(String[] args) throws Exception {
4. new Starter().makeItSo();
5. }
6. public Starter(){
7. x = 5;
8. start();
9. }
10. public void makeItSo() throws Exception {
11. join();
12. x = x - 1;
13. System.out.println(x);
14. }
15. public void run() { x *= 2; }
16. }
A. 4
B. 5
C. 8
D. 9
E. Compilation fails.
F. An exception is thrown at runtime.
G. It is impossible to determine for certain.
Answer: D
: join() 공부
Waits for this thread to die.
: 이러한 맥락에서 죽을 때까지 기다립니다.
An invocation of this method behaves in exactly the same way as the invocation
: 이 메서드의 호출이 호출과 정확히 동일한 방식으로 행동한다.
QUESTION 4 Given:
1. class PingPong2 {
2. synchronized void hit(long n) {
3. for(int i = 1; i < 3; i++)
4. System.out.print(n + "-" + i + " ");
5. }
6. }
1. public class Tester implements Runnable {
2. static PingPong2 pp2 = new PingPong2();
3. public static void main(String[] args) {
4. new Thread(new Tester()).start();
5. new Thread(new Tester()).start();
6. }
7. public void run() { pp2.hit(Thread.currentThread().getId()); }
8. }
Which statement is true?
: 옳은 설명은?
A. The output could be 5-1 6-1 6-2 5-2
B. The output could be 6-1 6-2 5-1 5-2
C. The output could be 6-1 5-2 6-2 5-1
D. The output could be 6-1 6-2 5-1 7-1
Answer: B
: synchronized 공부
QUESTION 5 Given:
1. public abstract class Shape {
2. private int x;
3. private int y;
4. public abstract void draw();
5. public void setAnchor(int x, int y) {
6. this.x = x;
7. this.y = y;
8. }
9. }
Which two classes use the Shape class correctly? (Choose two.)
: Shape 클래스를 정확하게 사용한 두 개의 클래스는 어떤 것인가? (2개를 고르시오.)
A. public class Circle implements Shape { private int radius; }
B. public abstract class Circle extends Shape { private int radius; }
C. public class Circle extends Shape { private int radius; public void draw(); }
D. public abstract class Circle implements Shape { private int radius; public void draw(); }
E. public class Circle extends Shape { private int radius; public void draw() {/* code here */} } F. public abstract class Circle implements Shape { private int radius; public void draw() {/* code here */} }
Answer: BE
QUESTION 6 Given:
1. public class Barn {
2. public static void main(String[] args) {
3. new Barn().go("hi", 1);
4. new Barn().go("hi", "world", 2);
5. }
6. public void go(String... y, int x) {
7. System.out.print(y[y.length - 1] + " ");
8. }
9. }
What is the result?
: 결과는 무엇인가?
A. hi hi
B. hi world
C. world world
D. Compilation fails.
E. An exception is thrown at runtime.
Answer: D
: variable argument 공부
QUESTION 7 Given:
09. class Nav{
10. public enum Direction { NORTH, SOUTH, EAST, WEST }
11. }
12.
13. public class Sprite{
14. // insert code here
15. }
Which code, inserted at line 14, allows the Sprite class to compile?
: 14라인에 삽입되면, Sprite 클래스가 컴파일 될 수 있는 코드는 어느 것인가?
A. Direction d = NORTH;
B. Nav.Direction d = NORTH;
C. Direction d = Direction.NORTH;
D. Nav.Direction d = Nav.Direction.NORTH;
Answer: D
QUESTION 8
Which statement is true about the classes and interfaces?
: classes 와 interfaces 에 관련해서 사실인 것은?
1. public interface A {
2. public void doSomething(String thing);
3. }
1. public class AImpl implements A {
2. public void doSomething(String msg) {}
3. }
1. public class B {
2. public A doit(){
3. //more code here
4. }
5. public String execute(){
6. //more code here
7. }
8. }
1. public class C extends B {
2. public AImpl doit(){
3. //more code here
4. }
5.
6. public Object execute() {
7. //more code here
8. }
9. }
A. Compilation will succeed for all classes and interfaces.
B. Compilation of class C will fail because of an error in line 2.
C. Compilation of class C will fail because of an error in line 6.
D. Compilation of class AImpl will fail because of an error in line 2.
Answer: C
QUESTION 9
What is the result?
: 결과는 무엇인가?
11. public class Person {
12. String name = "No name";
13. public Person(String nm) { name = nm; }
14. }
15.
16. public class Employee extends Person {
17. String empID = "0000";
18. public Employee(String id) { empID = id; }
19. }
20.
21. public class EmployeeTest {
22. public static void main(String[] args){
23. Employee e = new Employee("4321");
24. System.out.println(e.empID);
25. }
26. }
A. 4321
B. 0000
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 18.
Answer: D
: 상속 생성자 공부
QUESTION 10 Given:
1. public class Rainbow {
2. public enum MyColor {
3. RED(0xff0000), GREEN(0x00ff00), BLUE(0x0000ff);
4. private final int rgb;
5. MyColor(int rgb) { this.rgb = rgb; }
6. public int getRGB() { return rgb; }
7. };
8. public static void main(String[] args) {
9. //insert code here
10. }
11. }
Which code fragment, inserted at line 19, allows the Rainbow class to compile?
: 19라인에 삽입되면, Rainbow 클래스가 컴파일 될 수 있는 코드 조각은 어느 것인가?
A. MyColor skyColor = BLUE;
B. MyColor treeColor = MyColor.GREEN;
C. if(RED.getRGB() < BLUE.getRGB()) { }
D. Compilation fails due to other error(s) in the code.
E. MyColor purple = new MyColor(0xff00ff);
F. MyColor purple = MyColor.BLUE + MyColor.RED;
Answer: B
QUESTION 11 Given:
1. class Atom {
2. Atom() { System.out.print("atom "); }
3. }
4. class Rock extends Atom {
5. Rock(String type) { System.out.print(type); }
6. }
7. public class Mountain extends Rock {
8. Mountain() {
9. super("granite ");
10. new Rock("granite ");
11. }
12. public static void main(String[] a) { new Mountain(); }
13. }
What is the result?
: 결과는 무엇인가?
A. Compilation fails.
B. atom granite
C. granite granite
D. atom granite granite
E. An exception is thrown at runtime.
F. atom granite atom granite
Answer: F
QUESTION 12
Given:
01. interface TestA { String toString(); }
02.
03. public class Test {
04. public static void main(String[] args) {
05. System.out.println(new TestA() {
06. public String toString() { return "test"; }
07. });
08. }
09. }
What is the result?
: 결과는 무엇인가?
A. test
B. null
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 1.
E. Compilation fails because of an error in line 4.
F. Compilation fails because of an error in line 5.
Answer: A
QUESTION 13
Given:
1. public static void parse(String str) {
2. try {
3. float f = Float.parseFloat(str);
4. } catch (NumberFormatException nfe) {
5. f = 0;
6. } finally {
7. System.out.println(f);
8. }
9. }
10. public static void main(String[] args) {
11. parse("invalid");
12. }
What is the result?
: 결과는 무엇인가?
A. 0.0
B. Compilation fails.
C. A ParseException is thrown by the parse method at runtime.
D. A NumberFormatException is thrown by the parse method at runtime.
Answer: B
QUESTION 14
Given:
1. public class Blip {
2. protected int blipvert(int x) { return 0; }
3. }
4. class Vert extends Blip {
5. // insert code here
6. }
Which five methods, inserted independently at line 5, will compile? (Choose five.)
: 5줄에 독립적으로 삽입 되어 컴파일이 되는 다섯 메소트는 어느 것인가? (5개 고르시오.)
A. public int blipvert(int x) { return 0; }
B. private int blipvert(int x) { return 0; }
C. private int blipvert(long x) { return 0; }
D. protected long blipvert(int x) { return 0; }
E. protected int blipvert(long x) { return 0; }
F. protected long blipvert(long x) { return 0; }
G. protected long blipvert(int x, int y) { return 0; }
Answer: ACEFG
QUESTION 15
Given:
1. class Super {
2. private int a;
3. protected Super(int a) { this.a = a; }
4. }
11. class Sub extends Super {
12. public Sub(int a) { super(a); }
13. public Sub() { this.a = 5; }
14. }
Which two, independently, will allow Sub to compile? (Choose two.)
: 독립적으로 Sub 클래스가 컴파일 되도록 하는 2개는 어느 것인가? (2개를 고르시오.)
A. Change line 2 to: public int a;
B. Change line 2 to: protected int a;
C. Change line 13 to: public Sub() { this(5); }
D. Change line 13 to: public Sub() { super(5); }
E. Change line 13 to: public Sub() { super(a); }
Answer: CD
QUESTION 16
Which Man class properly represents the relationship "Man has a best friend who is a Dog"?
: Man 클래스가 "Man has a best friend who is a Dog" 관계로 제대로 표현된 것은 어느 것인가?
A. class Man extends Dog { }
B. class Man implements Dog { }
C. class Man { private BestFriend dog; }
D. class Man { private Dog bestFriend; }
E. class Man { private Dog<bestFriend>; }
F. class Man { private BestFriend<dog>; }
Answer: D
QUESTION 17
Given:
1. package test;
2.
3. class Target {
4. public String name = "hello";
5. }
What can directly access and change the value of the variable name?
: 바로 접근할 수 있고, variable name 의 값을 변경할 수있는 것은 무엇인가?
A. any class
B. only the Target class
C. any class in the test package
D. any class that extends Target
Answer: C
QUESTION 18
Given:
11. abstract class Vehicle { public int speed() { return 0; }
12. class Car extends Vehicle { public int speed() { return 60; }
13. class RaceCar extends Car { public int speed() { return 150; } ...
21. RaceCar racer = new RaceCar();
22. Car car = new RaceCar();
23 Vehicle vehicle = new RaceCar();
24 System.out.println(racer.speed() + ", " + car.speed() + ", " + vehicle.speed());
What is the result?
: 결과는 무엇인가?
A. 0, 0, 0
B. 150, 60, 0
C. Compilation fails.
D. 150, 150, 150
E. An exception is thrown at runtime.
Answer: D
QUESTION 19
Given:
5. class Building { }
6. public class Barn extends Building {
7. public static void main(String[] args) {
8. Building build1 = new Building();
9. Barn barn1 = new Barn();
10. Barn barn2 = (Barn) build1;
11. Object obj1 = (Object) build1;
12. String str1 = (String) build1;
13. Building build2 = (Building) barn1;
14. }
15. }
Which is true?
: 사실인 것은?
A. If line 10 is removed, the compilation succeeds.
B. If line 11 is removed, the compilation succeeds.
C. If line 12 is removed, the compilation succeeds.
D. If line 13 is removed, the compilation succeeds.
E. More than one line must be removed for compilation to succeed.
Answer: C
QUESTION 20
A team of programmers is reviewing a proposed API for a new utility class. After some discussion, they realize that they can reduce the number of methods in the API without losing any functionality. If they implement the new design, which two OO principles will they be promoting?
A. Looser coupling
: 느슨한 결합
B. Tighter coupling
: 강한 결합
C. Lower cohesion
: 낮은 응집력
D. Higher cohesion
: 강한 응집력
E. Weaker encapsulation
: 약한 캡슐화
F. Stronger encapsulation
: 강한 캡슐화
Answer: AD
이해가 안되는 문제가 있다면 글 남겨주세요. 저도 JAVA 공부하면서 같이 해결해요~
Today.
Is the fish fresh?
: 이 생선 싱싱해요?
Yes. It was delivered today.
: 네, 오늘 들어왔어요.
OCJP - Oracle 자격증 관련 가입부터 싸게 바우처 사기...
OCJP 가 궁금하다면 포스트 준비... 시작!
그럼 뭘 해야 하지?
보통 우리나라에서는 자격증 관련 공인 사이트에 들어가서 가입하고 시험료를 지불했었지.
그래 그런게 있을꺼야.
그런데 외국자격증이면 어케 해야되는거지?
...
검색 고고싱!
...
음. 역시 사이트가 있었군.
난 한국인이므로 아래 사이트로 접속
https://korea.pearsonvue.com/
오 이쁜 Lady 께서 자격증 사진이 자신(?)이라는 것을 어필하기 위해
애써 밝게 웃고 있는 것인가? 하여튼 좋군.
그런데 뭐야... 이거. 담에 뭘 눌러야 되지.
일단 OCJP가 궁금한거니깐 응시자를. 클릭.
여기서는 시험 과목을 시험 프로그램이라고 하는가 봉가? 일단 목록 클릭.
내가 원하는 건 OCJP인데.
일단 JAVA 가 Oracle 꺼니 당연한건가. 일단 클릭.
아 Oracle 꺼니 뭐니 하니깐 결국 Oracle 이 모습을 드러내 버렸다.
역시 가입을 해야되겠지. :(
그저 동의만 할뿐...
강조한 부분은 다 입력하고 나서...
여기서 중요한 것은 영어로 적는다. ㅋㅋㅋㅋㅋ
영어로 입력한 부분을 뿌듯하게 바라보면서 Next
아 물론. 주소를 영어로 적는 일은 흔한 일이 아니니깐.
(그래 그럴꺼야. ㅎㅎㅎ 아 영어에 더 관심을 가져야겠어 ㅡ.,ㅡ)
도로명 주소 안내시스템에 가면 영어주소를 지원해줍니다.
OPN이라는 것을 물어보지만 당연히 없지..
역시 Next
짜잔. 가입완료.
자 그럼 이제 가입을 완료했으니 바우처를 사야되는데,
헉 28~30만원? 원달러 환율을 계산해보니 얼마얼마한 가격이라니... ㄷㄷ
훗. 다음 기회로 OCJP는 미뤄야 겠군.
역시.. 조금만 더 찾아보니 세일 아닌 세일.
더 싼 곳을 찾았다능... ㅜ.ㅜ 무려 23만원.
아... 물건을 샀는데 딴 곳에서는 더 싼거 보면 배가 아파서 이틀을 앓아누웠었는데.
그래도 이번에는 바우처 사기전에 이곳을 알게 되서 다행. 휴우~
해당 사이트의 전화번호로 연락해서 바우처를 획득.
무통장 입금으로다가 싸게 Get.
1주 정도의 시간이 지나서 바우처 번호를 받았다.
그럼 뭘 해야 하지?
보통 우리나라에서는 자격증 관련 공인 사이트에 들어가서 가입하고 시험료를 지불했었지.
그래 그런게 있을꺼야.
그런데 외국자격증이면 어케 해야되는거지?
...
검색 고고싱!
...
음. 역시 사이트가 있었군.
난 한국인이므로 아래 사이트로 접속
https://korea.pearsonvue.com/
오 이쁜 Lady 께서 자격증 사진이 자신(?)이라는 것을 어필하기 위해
애써 밝게 웃고 있는 것인가? 하여튼 좋군.
그런데 뭐야... 이거. 담에 뭘 눌러야 되지.
일단 OCJP가 궁금한거니깐 응시자를. 클릭.
여기서는 시험 과목을 시험 프로그램이라고 하는가 봉가? 일단 목록 클릭.
내가 원하는 건 OCJP인데.
일단 JAVA 가 Oracle 꺼니 당연한건가. 일단 클릭.
아 Oracle 꺼니 뭐니 하니깐 결국 Oracle 이 모습을 드러내 버렸다.
역시 가입을 해야되겠지. :(
그저 동의만 할뿐...
강조한 부분은 다 입력하고 나서...
여기서 중요한 것은 영어로 적는다. ㅋㅋㅋㅋㅋ
영어로 입력한 부분을 뿌듯하게 바라보면서 Next
아 물론. 주소를 영어로 적는 일은 흔한 일이 아니니깐.
(그래 그럴꺼야. ㅎㅎㅎ 아 영어에 더 관심을 가져야겠어 ㅡ.,ㅡ)
도로명 주소 안내시스템에 가면 영어주소를 지원해줍니다.
OPN이라는 것을 물어보지만 당연히 없지..
역시 Next
짜잔. 가입완료.
자 그럼 이제 가입을 완료했으니 바우처를 사야되는데,
헉 28~30만원? 원달러 환율을 계산해보니 얼마얼마한 가격이라니... ㄷㄷ
훗. 다음 기회로 OCJP는 미뤄야 겠군.
역시.. 조금만 더 찾아보니 세일 아닌 세일.
더 싼 곳을 찾았다능... ㅜ.ㅜ 무려 23만원.
아... 물건을 샀는데 딴 곳에서는 더 싼거 보면 배가 아파서 이틀을 앓아누웠었는데.
그래도 이번에는 바우처 사기전에 이곳을 알게 되서 다행. 휴우~
무통장 입금으로다가 싸게 Get.
1주 정도의 시간이 지나서 바우처 번호를 받았다.
받은 바우처를 가지고 https://korea.pearsonvue.com/ 로 가서 시험등록을 해도 되지만,
바우처를 구입했다면 EXCEL로 된 응시원서를 보내주면 알아서 시험등록을 해주신다는.
그럼 시험을 치기로 한 날짜에 가서 시험을 치면 된다능.
그럼 합격하길 파이팅이라능. You can do it!
Today.
You remember we have an appointment today, don't you?
: 오늘 만나기로 한 약속 기억하죠?
Yes, see you soon.
: 네, 이따가 봐요.
2016년 4월 23일 토요일
Stay OR Change.
1. 희극지왕
개봉일: 1999년 2월 13일
감독: 주성치, 이력지
음악: 다이스케 히나타, 레이몬드 웡
각본: 주성치, 민 훈 펑, 에리카 리
수상 후보 선정: 홍콩 영화 금상장 신인상
2. 뭐가 추가 될까? 아님 끝인가.
개봉일: 1999년 2월 13일
감독: 주성치, 이력지
음악: 다이스케 히나타, 레이몬드 웡
각본: 주성치, 민 훈 펑, 에리카 리
수상 후보 선정: 홍콩 영화 금상장 신인상
2. 뭐가 추가 될까? 아님 끝인가.
2016년 4월 20일 수요일
Convert Number Month to Alphabet
OS : Windows 7
DBMS : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
후아암. 잠 온다.
포스트 적고, 하던 거 하다가, 잼있는 거 좀 보다가 하려고 했던 거 좀 하다가 자야겠다.
아! 그래서 내가 늘 피곤한가!
anyway,
갑자기 일 하는 중에, 1년의 달을 알파벳으로 구분해 놓은 대단한 데이터들이 있어서 부랴부랴. 인터넷 검색.
집으로 퇴근하기 위한 피나는 노력으로 ctrl + c, ctrl + v.
그리고 본인은 집에 와 있음. 냐하하하하
이야기가 옆으로 새지만 간단히 말하면.
2016.01 이면 '1'월 이니깐 알파벳으로 'A',
2016.02 이면 '2'월 이니깐 알파벳으로 'B',
2016.03 이면 '3'월 이니깐 알파벳으로 'C',
2016.04 이면 '4'월 이니깐 알파벳으로 'D',
2016.05 이면 '5'월 이니깐 알파벳으로 'E',
...
2016.11 이면 '11'월 이니깐 알파벳으로 'K',
2016.12 이면 '12'월 이니깐 알파벳으로 'L'.
으로 데이터를 만들면 됨. 물론 ORACLE SQL쿼리로.
해결 방법은 무쟈게 쉬움
SELECT CHR(TO_NUMBER(SUBSTR('20160420', 5, 2)) + 64)
FROM DUAL;
04월이니깐 'D'가 나옴. 끝~~
해커스 잠시 보다가.
Today.
It's certainly much cheaper than driving a car.
: 차를 운전하는 것 보다는 확실히 비용이 덜 들어요.
DBMS : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
후아암. 잠 온다.
포스트 적고, 하던 거 하다가, 잼있는 거 좀 보다가 하려고 했던 거 좀 하다가 자야겠다.
아! 그래서 내가 늘 피곤한가!
anyway,
갑자기 일 하는 중에, 1년의 달을 알파벳으로 구분해 놓은 대단한 데이터들이 있어서 부랴부랴. 인터넷 검색.
집으로 퇴근하기 위한 피나는 노력으로 ctrl + c, ctrl + v.
그리고 본인은 집에 와 있음. 냐하하하하
이야기가 옆으로 새지만 간단히 말하면.
2016.01 이면 '1'월 이니깐 알파벳으로 'A',
2016.02 이면 '2'월 이니깐 알파벳으로 'B',
2016.03 이면 '3'월 이니깐 알파벳으로 'C',
2016.04 이면 '4'월 이니깐 알파벳으로 'D',
2016.05 이면 '5'월 이니깐 알파벳으로 'E',
...
2016.11 이면 '11'월 이니깐 알파벳으로 'K',
2016.12 이면 '12'월 이니깐 알파벳으로 'L'.
으로 데이터를 만들면 됨. 물론 ORACLE SQL쿼리로.
해결 방법은 무쟈게 쉬움
SELECT CHR(TO_NUMBER(SUBSTR('20160420', 5, 2)) + 64)
FROM DUAL;
04월이니깐 'D'가 나옴. 끝~~
해커스 잠시 보다가.
Today.
It's certainly much cheaper than driving a car.
: 차를 운전하는 것 보다는 확실히 비용이 덜 들어요.
2016년 4월 3일 일요일
Disassembly in visual studio
개발 환경
OS : Windows 8 64 Bit
Platform : Microsoft Visual Studio Professional 2013
Project : Disassembly
DBMS : no need
My mental state : not good
The reliability of this article : Low
Ctrl + C, Ctrl + V 를 사랑하는 필자는 그냥 필요한 코드가 있으면 어딘가에 있겠지 하는 생각으로 정말 어딘가에서 가져와 쓰는 프로그래머다. ;)
그런데 가끔씩 복사, 붙여넣기를 하면서 옛날에 어셈블리어 사용할 때랑 지금이랑 비교하면 어떨까 하는 생각이 문득 들어 찾아 보기로 급 결심.
이제 필자가 적을 포스팅 내용은 단 2가지만 할 줄 알면 이해하는데 어려움이 없다.
1. 한글을 안다. (물론 한글을 읽고 해독할 수 있는 언어학적 능력도 필요)
2. visual studio 을(를) 설치할 정도의 능력을 가진 자.
- 2.1 visual studio 무료다운로드라고 검색하면 나오는 주소
- 2.2 2.1의 url 경로에 들어가서 설치를 할 수 있는 자.
웹 설치 관리자 든 iso 든 설치는 무조건 된다. 그 과정을 알아가는것이 힘들 뿐.
2.2 에서 좌절을 한다면 그냥 포기하는게 좋다. 심신 건강을 위해서도.
만약 초짜가 2.2 를 성공한다면 훗... 천재데?
- 2.3 설치가 끝난 후 실행을 할 수 있는 능력자.
생각외로 2.3에서 막힌다고 한다면 웃을텐가?
- 2.4 시간이 남는 능력자
이 글까지 읽고 있다면 시간이 모자라지는 않겠지만, 아래 내용이 수 분을 소요.
급한 용무가 있다면 중단하라.
3. visual studio c# 프로젝트 생성이라고 검색하면 나오는 주소
4. 3번을 성공하다니... 그럼 시작 버튼을 눌러 윈도우 응용 프로그램을 실행
5. 아무 코딩도 하지 않았으니 하얀 빈 창만 뜰 것이지만, 우리는 Disassembly 가 목적.
무시하고 아래의 그림대로 메뉴를 펼쳐본다.
6. 디스어셈블리를 눌러 보면.
디스어셈블리를 실행 모드에서 표시할 수 없습니다. 라고 잘 된다...? 오잉 뭐지.
전에 했던 기억이 있는데 이거 왜 이래. 봄비에 벛꽃이 휘날리도록 맞고 싶나.
7. 6번으로 인한 잠시 휴식.
8. 역시 나의 뇌용량은 부족한게 틀림없어. 아니 내가 좋아하는 것들을 기억하고 있어야
하니 남은 뇌용량이 없는 것은 당연한가. ㄷㄷㄷ(이래서 포스팅을 해야 되.)
어쨌든, 갑자기 생각나서 다시 포스팅 시작.
9. 윈도우 응용 프로그램의 디자인 단에서 그림과 같이 setting
단순히 textbox 와 button 을 추가한거라고 하고 싶지만 초짜라면 힘들겠지.
초짜분들은 심신이 어지러워 진다면 포기하시죠. 케헤헤헤.
그래도 포기 안한다면 도구상자를 열어보면 나온다고만 해두죠.
10. 이제 디자인 창에 다 올렸다면 코딩 시작.
아직까지 포기 안한 초짜가 있다면 9번에서 추가한 버튼을 마우스로 더블 클릭.
11. 아래 그림같이 코딩
뭐 그림처럼 코딩하는 거야.라고 하지만 초짜인 분들은 어려울 수 있음
괜히 스트레스 받고 그런다면 지금이라도 포기하는게 좋음.
아! 왠 빨간 색 테두리에 빨간 색 점이 보인다고 한다면. 중단점이라고만 해두죠.
12. 11번까지 한 상태에서 다시 시작 버튼을 눌러서 실행.
이제 실행한 윈도우 창에 버튼이 하나 보임. 살포시 버튼을 클릭해 줌.
13. 12번을 했더니 끝.
14. 복사, 붙여넣기에는 어셈블리어 싫어
Today.
남들보다 더 가지려는 것은 욕심이야,
자신 스스로 노력하여 얻은 것은 성실함이겠지.
남들보다 더 아름다워지거나 빛나보이려는 것은 허영심이야,
자신 스스로 아름다워지거나 빛나보이게 위해 노력하는 것은 자애심이겠지.
남보다 잘났다는 생각은 자만심이야,
자신이 잘났다는 생각은 자존감이겠지.
사촌이 땅을 사면 배가 아프다 보다야,
사촌이 땅을 사면 가본다 이겠지.
OS : Windows 8 64 Bit
Platform : Microsoft Visual Studio Professional 2013
Project : Disassembly
DBMS : no need
My mental state : not good
The reliability of this article : Low
Ctrl + C, Ctrl + V 를 사랑하는 필자는 그냥 필요한 코드가 있으면 어딘가에 있겠지 하는 생각으로 정말 어딘가에서 가져와 쓰는 프로그래머다. ;)
그런데 가끔씩 복사, 붙여넣기를 하면서 옛날에 어셈블리어 사용할 때랑 지금이랑 비교하면 어떨까 하는 생각이 문득 들어 찾아 보기로 급 결심.
이제 필자가 적을 포스팅 내용은 단 2가지만 할 줄 알면 이해하는데 어려움이 없다.
1. 한글을 안다. (물론 한글을 읽고 해독할 수 있는 언어학적 능력도 필요)
2. visual studio 을(를) 설치할 정도의 능력을 가진 자.
- 2.1 visual studio 무료다운로드라고 검색하면 나오는 주소
- 2.2 2.1의 url 경로에 들어가서 설치를 할 수 있는 자.
웹 설치 관리자 든 iso 든 설치는 무조건 된다. 그 과정을 알아가는것이 힘들 뿐.
2.2 에서 좌절을 한다면 그냥 포기하는게 좋다. 심신 건강을 위해서도.
만약 초짜가 2.2 를 성공한다면 훗... 천재데?
- 2.3 설치가 끝난 후 실행을 할 수 있는 능력자.
생각외로 2.3에서 막힌다고 한다면 웃을텐가?
- 2.4 시간이 남는 능력자
이 글까지 읽고 있다면 시간이 모자라지는 않겠지만, 아래 내용이 수 분을 소요.
급한 용무가 있다면 중단하라.
3. visual studio c# 프로젝트 생성이라고 검색하면 나오는 주소
4. 3번을 성공하다니... 그럼 시작 버튼을 눌러 윈도우 응용 프로그램을 실행
5. 아무 코딩도 하지 않았으니 하얀 빈 창만 뜰 것이지만, 우리는 Disassembly 가 목적.
무시하고 아래의 그림대로 메뉴를 펼쳐본다.
디스어셈블리를 실행 모드에서 표시할 수 없습니다. 라고 잘 된다...? 오잉 뭐지.
전에 했던 기억이 있는데 이거 왜 이래. 봄비에 벛꽃이 휘날리도록 맞고 싶나.
7. 6번으로 인한 잠시 휴식.
8. 역시 나의 뇌용량은 부족한게 틀림없어. 아니 내가 좋아하는 것들을 기억하고 있어야
하니 남은 뇌용량이 없는 것은 당연한가. ㄷㄷㄷ(이래서 포스팅을 해야 되.)
어쨌든, 갑자기 생각나서 다시 포스팅 시작.
9. 윈도우 응용 프로그램의 디자인 단에서 그림과 같이 setting
단순히 textbox 와 button 을 추가한거라고 하고 싶지만 초짜라면 힘들겠지.
초짜분들은 심신이 어지러워 진다면 포기하시죠. 케헤헤헤.
그래도 포기 안한다면 도구상자를 열어보면 나온다고만 해두죠.
10. 이제 디자인 창에 다 올렸다면 코딩 시작.
아직까지 포기 안한 초짜가 있다면 9번에서 추가한 버튼을 마우스로 더블 클릭.
11. 아래 그림같이 코딩
뭐 그림처럼 코딩하는 거야.라고 하지만 초짜인 분들은 어려울 수 있음
괜히 스트레스 받고 그런다면 지금이라도 포기하는게 좋음.
아! 왠 빨간 색 테두리에 빨간 색 점이 보인다고 한다면. 중단점이라고만 해두죠.
12. 11번까지 한 상태에서 다시 시작 버튼을 눌러서 실행.
이제 실행한 윈도우 창에 버튼이 하나 보임. 살포시 버튼을 클릭해 줌.
13. 12번을 했더니 끝.
14. 복사, 붙여넣기에는 어셈블리어 싫어
Today.
남들보다 더 가지려는 것은 욕심이야,
자신 스스로 노력하여 얻은 것은 성실함이겠지.
남들보다 더 아름다워지거나 빛나보이려는 것은 허영심이야,
자신 스스로 아름다워지거나 빛나보이게 위해 노력하는 것은 자애심이겠지.
남보다 잘났다는 생각은 자만심이야,
자신이 잘났다는 생각은 자존감이겠지.
사촌이 땅을 사면 배가 아프다 보다야,
사촌이 땅을 사면 가본다 이겠지.
2016년 3월 29일 화요일
프린터 설치 (KONICA MINOLTA)
1. 장치 및 프린터
2. 프린터 및 팩스
오른쪽 마우스 -> 프린터 추가
네트워크, 무선 또는 Bluetooth 프린터 추가
사용가능한 프린터 찾는 중 후,
C364Series 선택
(프린터에 랜이 연결이 되어 있어야 함. 프린터 설명서의 IP 설정을 참조하셔도 되고).
여하튼 맞는 IP 선택. 만약 IP 선택을 잘못한다면?
큰 회사라면 자신의 문서가 다른 부서에서 인쇄될지도. ㅎㅎ~
아래의 글은 드라이버를 컴터에 다운 받았다고 가정하고 함.
프린터 추가 화면 뜸
디스크 있음 버튼 클릭
디스크에서 설치 화면 뜸
찾아보기 눌러.
D:\설치 프로그램\프린트 드라이버\코니카미놀타복합기드라이버\Drivers\PCL\KO\Win_x86
필자는 32bit 라 x86 선택
64bit 는 x64 폴더 선택
확인 버튼 눌름
KONICA MINOLTA C364Series 선택 후 다음 버튼 눌름
프린트 이름은 자기 마음대로
프린터 설치 중 화면 뜸
그냥 기다림
기본 프린터로 설정하든 말든 맘대로.
3. 네트웤 설정
4. 공유 폴더 설정
5. 프린터 수신지 등록
Scan to SMB 설정 방법
이상 끝~~
Today.
Life is a long lesson in humility. - James M. Barrie
(인생은 겸손에 대한 오랜 수업이다.)
2. 프린터 및 팩스
오른쪽 마우스 -> 프린터 추가
네트워크, 무선 또는 Bluetooth 프린터 추가
사용가능한 프린터 찾는 중 후,
C364Series 선택
(프린터에 랜이 연결이 되어 있어야 함. 프린터 설명서의 IP 설정을 참조하셔도 되고).
여하튼 맞는 IP 선택. 만약 IP 선택을 잘못한다면?
큰 회사라면 자신의 문서가 다른 부서에서 인쇄될지도. ㅎㅎ~
아래의 글은 드라이버를 컴터에 다운 받았다고 가정하고 함.
프린터 추가 화면 뜸
디스크 있음 버튼 클릭
디스크에서 설치 화면 뜸
찾아보기 눌러.
D:\설치 프로그램\프린트 드라이버\코니카미놀타복합기드라이버\Drivers\PCL\KO\Win_x86
필자는 32bit 라 x86 선택
64bit 는 x64 폴더 선택
확인 버튼 눌름
KONICA MINOLTA C364Series 선택 후 다음 버튼 눌름
프린트 이름은 자기 마음대로
프린터 설치 중 화면 뜸
그냥 기다림
기본 프린터로 설정하든 말든 맘대로.
3. 네트웤 설정
4. 공유 폴더 설정
5. 프린터 수신지 등록
Scan to SMB 설정 방법
이상 끝~~
Today.
Life is a long lesson in humility. - James M. Barrie
(인생은 겸손에 대한 오랜 수업이다.)
피드 구독하기:
글 (Atom)
대항해시대 조선 랭작
숙련도 획득 방법 선박 건조, 선박 강화, 전용함 추가시 숙련도 획득 모두 동일한 공식 적용 획득 숙련도 공식 기본 획득 숙련도 ≒ int{건조일수 × 현재랭크 × (0.525)} 이벤트 & 아이템 사용...
-
Version : OZ Designer 3.0 내용: 아무 의미 없다. 라벨 스크립트에 현재 날짜가 나오도록 해달라고 해서 급하게 추가된 라벨 스크립트. 물론 데이터 형태를 시스템(System)으로 하고 필드 이름을 데이트(Date)로 ...
-
ERP 용어 용어 설명 ABAP/4 ( A dvanced B usiness A pplication P rogram for 4 -generation Language) 협업 비즈니스 솔루션 회사 SAP AG가 개발한 4세대 고급 프로그래밍...