1 / 7

Oracle 1Z0-808 Questions and Answers

Get complete detail on 1Z0-808 exam guide to crack Oracle Certified Associate Java SE 8 Programmer. You can collect all information on 1Z0-808 tutorial, practice test, books, study material, exam questions, and syllabus. Firm your knowledge on Oracle Certified Associate Java SE 8 Programmer and get ready to crack 1Z0-808 certification. Explore all information on 1Z0-808 exam with number of questions, passing percentage and time duration to complete test.

alicesigzen
Download Presentation

Oracle 1Z0-808 Questions and Answers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WWW.DBexam.com Java SE 8 Fundamentals Pearson VUE - Oracle 1Z0-808 Online Practice Exam 1

  2. WWW.DBexam.com We Will Provide You Latest Exam Question and Answers. 1)What is the character limit for a Single Line of Text field? a)It is implemented as an array of the specified element type. b)Using a row by column convention, each row of a two-dimensional array must be of the same size. c)At declaration time, the number of elements of the array in each dimension must be specified. d)All methods of the class Object may be invoked on the two-dimensional array. Ans. A, D 2)Given: import java.util.ArrayList; import java.util.List; public class JavaSETest { public static void main(String[] args) { List<Integer> elements = new ArrayList<>(); elements.add(10); int firstElmnt = elements.get(1); System.out.println(firstElmnt); } } What is the result? a)null b)10 c)0 d)An IndexOutOfBoundsException is thrown at runtime. Ans. D 2

  3. WWW.DBexam.com 3)Given: abstract class Writer { public static void write() { System.out.println("Writing..."); } } class Author extends Writer { public static void write() { System.out.println("Writing book"); } } public class Programmer extends Writer { public static void write() { System.out.println("Writing code"); } public static void main(String[] args) { Writer w = new Programmer(); w.write(); } } What is the result? a)Writing... b)Writing book c)Writing code d)Compilation fails. Ans. A 4)Which access modifier makes a member available only to classes within the same package or subclasses? a)private b)protected c)public d)package-private Ans. B 5)Given: class SuperClass { SuperClass(int x) { System.out.println("Super"); } } public class SubClass extends SuperClass { SubClass() { 3

  4. WWW.DBexam.com // Line n1 System.out.println("Sub 2"); } } Which statement, when inserted at Line n1, enables the code to compile? a)this(10); b)super(10); c)SuperClass(10); d)super.SuperClass (10); Ans. B 6)Given the code fragment: // Line n1 switch (cardVal) { case 4: case 5: case 6: case 7: case 8: System.out.println("Hit"); break; case 9: case 10: case 11: System.out.println("Double"); break; case 15: case 16: System.out.println("Surrender"); break; default: System.out.println("Stand"); } Which two code fragments can be inserted at Line n1, independently, enable to print Stand? a)int cardVal = 6; b)int cardVal = 10; c)int cardVal = 14; d)int cardVal = 18; Ans. C, D 4

  5. WWW.DBexam.com 7)Which of the following exception types must be handled or declared by the method in which they are thrown? a)NullPointerException b)Exception c)RuntimeException d)ArithmeticException Ans. B 8)Given the code fragment: public class Test { public static void main(String[] args) { int x = 10; int y = 2; try { for (int z = 2; z >= 0; z--) { int ans = x / z; System.out.print(ans+ " "); } } catch (Exception e1) { System.out.println("E1"); } catch (ArithmeticException e1) { System.out.println("E2"); } } } What is the result? a)E1 b)E2 c)5 10 E1 d)Compilation fails. Ans. B 9)Given the code fragment: public class TestClass { public static void main(String[] args) { List<String> items = new ArrayList<>(); items.add("Pen"); items.add("Pencil"); items.add("Box"); for (String i : items) { if (i.indexOf("P") == 0) { continue; } else { 5

  6. WWW.DBexam.com System.out.print(i+" "); } } } } What is the result? a)Pen Pencil Box b)Pen Pencil c)Box d)Compilation fails. Ans. C 10)Given the code fragment: StringBuilder s1 = new StringBuilder("Java"); String s2 = "Love"; s1.append(s2); s1.substring(4); int foundAt = s1.indexOf(s2); System.out.println(foundAt); What is the result? a)-1 b)3 c)4 d)A StringIndexOutOfBoundsException is thrown at runtime. Ans. C VISIT WWW.DBEXAM.COM 6

More Related