Oracle 1z0-808 Exam 2024: Question #11

Oracle 1z0-808 Exam: Question #11 해설 질문 원본 내용 Given: interface Readable { public void readBook(); public void setBookMark(); } abstract class Book implements Readable { // line n1 public void readBook() { } // line n2 } class EBook extends Book { // line n3 public void readBook() { } // line n4 } And given the code fragment: Book book1 = new EBook(); book1.readBook(); Which option enables the co..

Oracle 1z0-808 Exam 2024: Question #10

Oracle 1z0-808 Exam: Question #10 해설 질문 원본 내용 Given the following code: public static void main(String[] args) { StringBuilder sb = new StringBuilder("Java"); String s = "Java"; if (sb.toString().equals(s.toString())) { System.out.println("Match 1"); } else if (sb.equals(s)) { System.out.println("Match 2"); } else { System.out.println("No Match"); } } What is the result? A. Match 1 B. Match 2 C...

Oracle 1z0-808 Exam 2024: Question #9

Oracle 1z0-808 Exam : Question #9 해설 질문 원본 내용 Given these two classes: public class Customer { ElectricAccount acct = new ElectricAccount(); public void useElectricity(double kWh) { acct.addKWh(kWh); } } public class ElectricAccount { private double kWh; private double rate = 0.07; private double bill; // methods should be written here at line n1 } Any amount of electricity used by a customer (r..

Oracle 1z0-808 Exam 2024: Question #8

Oracle 1z0-808 Exam: Question #8 해설 질문 원본 내용 Given the following class declarations: class Caller { private void init() { System.out.println("Initialized"); } private void start() { init(); System.out.println("Started"); } } public class TestCall { public static void main(String[] args) { Caller c = new Caller(); c.start(); // line n1 c.init(); // line n2 } } What is the result? A. Compilation f..

Oracle 1z0-808 Exam 2024: Question #7

Oracle 1z0-808 Exam: Question #7 해설 질문 원본 내용 Given the following class declarations: abstract class Planet { protected void revolve() { // line n1 } abstract void rotate(); // line n2 } class Earth extends Planet { void revolve() { // line n3 } protected void rotate() { // line n4 } } And the following main method: Car c1 = new Car("Auto"); Car c2 = new Car("4W", 150, "Manual"); System.out.print..

Oracle 1z0-808 Exam 2024: Question #6

Oracle 1z0-808 Exam: Question #6 해설 질문 원본 내용 Consider the following code: abstract class Planet { protected void revolve() { // line n1 } abstract void rotate(); // line n2 } class Earth extends Planet { void revolve() { // line n3 } protected void rotate() { // line n4 } } Which two modifications, made independently, enable the code to compile? (Choose two.) A. Make the method at line n1 public..

Oracle 1z0-808 Exam 2024: Question #5

Oracle 1z0-808 Exam: Question #5 해설 질문 원본 내용 What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class? A. Encapsulation B. Inheritance C. Abstraction D. Instantiation E. Polymorphism 질문 번역 Java에서 접근 제어자를 사용하여 변수를 보호하고 클래스 내부에 숨기는 개념은 무엇인가요? A. 캡슐화 (Encapsulation) B. 상속 (Inheritance) C. 추상화 (Abstraction) D. 인스턴스화 (Instantiation) E. 다형성 (Pol..

Oracle 1z0-808 Exam 2024: Question #4

Oracle 1z0-808 Exam: Question #4 해설 질문 원본 내용 Consider the following code: public static void main(String[] args) { Short s1 = 200; Integer s2 = 400; Long s3 = (long) s1 + s2; // line n1 String s4 = (String) (s3 * s2); // line n2 System.out.println("Sum is " + s4); } What is the result? A. Sum is 600 B. Compilation fails at line n1. C. Compilation fails at line n2. D. A ClassCastException is thro..

Oracle 1z0-808 Exam 2024: Question #3

Oracle 1z0-808 Exam: Question #3 해설 질문 원본 내용 Question #3 Consider the following code: public static void main(String[] args) { String date = LocalDate .parse("2014-05-04") .format(DateTimeFormatter.ISO_DATE_TIME); System.out.println(date); } What is the result? A. May 04, 2014T00:00:00.000 B. 2014-05-04T00:00:00.000 C. 5/4/14T00:00:00.000 D. An exception is thrown at runtime. 질문 번역 다음 Java 코드에 대..

Oracle 1z0-808 Exam 2024: Question #2

Oracle 1z0-808 Exam: Question #2 해설 질문 원본 내용 Question #2 Which statement is true about the switch statement? A. It must contain the default section. B. The break statement, at the end of each case block, is optional. C. Its case label literals can be changed at runtime. D. Its expression must evaluate to a collection of values. 질문 번역 다음은 switch 문에 대한 진술입니다. 어느 것이 참인가요? A. 반드시 default 섹션이 포함되어야 한..

Oracle 1z0-808 Exam 2024: Question #1

질문 원본 내용 Question #1 Consider the following code: class Product { double price; } public class Test { public void updatePrice(Product product, double price) { price = price * 2; product.price = product.price + price; } public static void main(String[] args) { Product prt = new Product(); prt.price = 200; double newPrice = 100; Test t = new Test(); t.updatePrice(prt, newPrice); System.out.println..