본문 바로가기

Java

(115)
OCAJP(1z0-808) 후기 [시험 준비 및 후기] 1. 시험 준비시험 준비는 사실.... 별게 없다https://www.examtopics.com/ Free Exam Prep By IT Professionals | ExamTopicsExamTopics The only source for free & accurate actual exam questions & answers, passing your exam easily is guaranteed, and for free!www.examtopics.com모두가 아는 그 사이트에서 덤프 2회 돌리고블로그에 모르는 거 바로바로 정리시험 이틀 전부터 내가 모르는 부분 정리한 것들만 보았다.헷갈리는 개념은 계속 헷갈려서.. 2.시험 후기1) 신분증여권 2) 영어를 쓸 일이 있나?전혀 없음. 아무도 나에게 말을 걸지 ..
OCAJP(1z0-808) 후기 [시험등록 및 변경사항] 1. 후기 쓰는 이유자격증 여러개 따보았지만 OCAJP는 정말정말 정보가 너무너무 없다그리고 변경된 내용들도 있어서 oracle이랑 이메일로 이 시험이 맞냐! 내가 찾는 시험이 맞냐구!이렇게 확인하는 과정도 거쳤다.그리고 시험등록, 인증, 구매할 때에도 오라클 내 사이트 여기저기 다녀서 @_@ 이 느낌 이랄까...다른 사람들은 나와 같은 고생하지 않기를 바라며... 2. 변경 사항1) 문항수 70문제 > 56문제 문항수가 갑자기 너무 줄어서, 이거 진짜 내가 보는 시험 맞나? 의심들어서 orcale university측에 채팅보내고, 메일로 incident case 만들어서 확인을 받아냄.. 2) 시험 시간시간120분으로 변경 (원래는 150분) 3.시험 등록 절차 (대강)https://www.orac..
OCAJP 준비 (Q219 - Q236) 1.  인터페이스는 기본적으로 모든 메서드가 추상 메서드로 선언>> public abstract 인터페이스의 메서드는 기본적으로 모두 추상 메서드이지만, default 메서드나 static 메서드는 구현이 가능interface Speakable { void speak(String s); // 추상 메서드 default void greet() { // 기본 구현 제공 System.out.println("Hello!"); }} 2.public class App { // 클래스 멤버 변수 String myStr = "9009"; public void doStuff(String str) { int myNum = 0; // 로컬 변수 try {..
OCAJP 준비 (Q106 - Q125) 1.A. Only unchecked exceptions can be rethrown.>> Both checked and unchecked exceptions can be rethrown in Java. B. All subclasses of the RuntimeException class are not recoverable.>> RuntimeException and its subclasses are unchecked exceptions, but their recoverability depends on the specific situation and how the program is designed. C. The parameter in a catch block is of Throwable type.>> Th..
OCAJP 준비 (Q45 - Q65) 1.mport java.util.ArrayList;public class Main {public static void main(String[] args) {ArrayList myList = new ArrayList();String[] myArray;try{while (true){myList.add("My string");}}catch (RuntimeException e){System.out.println("catch RunTimeException");}catch (Exception e){System.out.println("catch Exception");}System.out.println("Ready to use ");}} runtime error is thrown in the thread "main"A..
OCAJP 준비 (Q26 - Q44) 1.class A { public A() { System.out.print("A "); // 1. 최상위 부모 생성자 }}class B extends A { public B() { super(); // 자동 호출 System.out.print("B "); // 2. 부모 생성자 }}class C extends B { public C() { super(); // 자동 호출 System.out.print("C "); // 3. 자식 생성자 컴파일러가 자동으로 super(); 를 삽입 }} A -> B -> C 2.class X { static int i; // 클래스 변수 (모든 객체가 공유) i..
OCAJP 준비 (Q01 - Q25) 순서대로 정리아님 - 기억하고 싶은 내용만 정리중 abstract class Parent {protected void revolve() {} // n1abstract void rotate(); // n2}class Earth extends Parent {void revolve() {} // n3protected void rotate() {} // n4} 1. Java의 캡슐화와 상속 규칙위에서 보면 n3은 default로 되어있는데 추상화의 경우부모클래스보다 자식클래스의 제한자의 범위는 무조건 같거나 더 넓어야 한다.따라서 n3를 public인 protected로 수정해야 그리고 n4를 public으로 더 넓게 수정할 수 있음 2. long타입은 String으로 형변환 불가  3.class Vehicle..
중첩 클래스 중첩 클래스?내부 클래스를 포함한 모든 중첩 클래스는 특정 클래스가 다른 하나의 클래스 안에서만 사용되거나아주 긴밀하게 연결되어 있는 특별한 경우에만 사용왜 사용?1) 논리적 그룹화특정 클래스가 다른 하나의 클래스 안에서만 사용되는 경우중첩 클래스가 외부에 노출되지 않는 장점2) 캡슐화중첩 클래스는 바깥 클래스의 private 멤버에 접근할 수 있음 1. 정적 중첩 클래스 * 중첩(Nested) : 어떤 다른 것이 내부에 위치하거나 포함되는 구조적인 관계 static O바깥 클래스의 인스턴스에 소속이 X바깥 클래스의 클래스 멤버에는 접근 가능 (private도 가능) 자신의 멤버에는 당연히 접근 가능 *private 접근 제어private 접근 제어자는 같은 클래스 안에 있을 때만 접근할 수 있음중첩 클..