[Free] 2018(Jan) EnsurePass Examcollection Oracle 1z0-804 Dumps with VCE and PDF 11-20

Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-804
100% Free Download! 100% Pass Guaranteed!

Java SE 7 Programmer II

Question No: 11

Given the classes:

Ensurepass 2018 PDF and VCE

What is the result?

  1. John Harry

  2. unknown Harry

  3. john unknown

  4. unknown unknown

  5. Compilation fails.

  6. An exception is thrown at runtime.

Answer: B Explanation:

getName() is missing in John, hence Pupils getName() is invoked and the String in Pupils scope returned.

Question No: 12


Ensurepass 2018 PDF and VCE

Which two statements are true about the writer class?

  1. It compiles without any changes.

  2. It compiles if the code void write (String s); is added at line***.

  3. It compiles if the code void write (); is added at line ***.

  4. It compiles if the code void write (string s) { } is added at line ***.

  5. It compiles if the code write () {}is added at line ***.

Answer: A Explanation:

An abstract class does not need to implement the interface methods.

Question No: 13

Given the two Java classes:

Ensurepass 2018 PDF and VCE

Which two code snippets, added independently at line ***, can make the Buzzword class compile?

  1. this ();

  2. this (100);

  3. this (quot;Buzzwordquot;);

  4. super ();

  5. super (100);

  6. super (quot;Buzzwordquot;);

Answer: C,F

Question No: 14


Ensurepass 2018 PDF and VCE

Which statement will iterate through Direction?

  1. for (Direction d : Direction.values()){



  2. for (Direction d : Direction.asList()){



  3. for (Direction d : Direction.iterator()){



  4. for (Direction d : Direction.asArray()){



Answer: A Explanation:

The static values() method of an enum type returns an array of the enum values. The foreach loop is a good

way to go over all of them.

//… Loop over all values.

for (Direction d : Direction.values()){ System.out.println(d); // PrintsNORTH, EAST, …


Question No: 15


Ensurepass 2018 PDF and VCE

What is the result?

  1. Daniel

  2. Unknown

  3. It may printquot;unknownquot;orquot;Danielquot;depending on the JVM implementation.

  4. Compilation fails.

  5. An exception is thrown at runtime.

Answer: D Explanation:

The compilation fails at line start();

Erstellen eines statischen Verweises auf die nicht statische Methode start() vom Typ Runner nicht m枚glich.Exception in thread quot;mainquot; java.lang.RuntimeException: Uncompilable source code – non-static method start()cannot be referenced from a static context

Question No: 16

Which four are true about enums?

  1. An enum is typesafe.

  2. An enum cannot have public methods or fields.

  3. An enum can declare a private constructor.

  4. All enums implicitly implement Comparable.

  5. An enum can subclass another enum.

  6. An enum can implement an interface.

Answer: A,C,D,F Explanation:

C: The constructor for an enum type must be package-private or private access. Reference: Java Tutorials,Enum Types

Question No: 17


Ensurepass 2018 PDF and VCE

Which statement, inserted at line 8, enables the code to compile?

  1. new Task().new Counter().increment();

  2. new Task().Counter().increment();

  3. new Task.Counter().increment();

  4. Task.Counter().increment();

  5. Task.Counter.increment();

Answer: C

Question No: 18

Which represents part of a DAO design pattern?

  1. interface EmployeeDAO { int getID();

    Employee findByID (intid); void update();

    void delete();


  2. class EmployeeDAO { int getID() { return 0;}

    Employee findByID (int id) { return null;} void update () {}

    void delete () {}


  3. class EmployeeDAO { void create (Employee e) {} void update (Employee e) {} void delete (int id) {}

    Employee findByID (int id) {return id}


  4. interface EmployeeDAO { void create (Employee e); void update (Employee e); void delete (int id); Employee findByID (int id);


  5. interface EmployeeDAO {

void create (Connection c, Employee e); void update (Connection c, Employee e); void delete (Connection c, int id); Employee findByID (Connection c, int id);


Answer: D

Question No: 19


Ensurepass 2018 PDF and VCE

Which group of method is moved to a new class when implementing the DAO pattern?

  1. public in getId ()

    public String getContractDetails ()

    public Void setContractDetails(String contactDetails) public String getName ()

    public void setName (String name)

  2. public int getId ()

    public String getContractDetails() public String getName()

    public Person getPerson(int id) throws Exception

  3. public void setContractDetails(String contractDetails) public void setName(String name)

  4. public Person getPerson(int id) throws Exception public void createPerson(Person p) throws Exception public void deletePerson(int id) throws Exception public void updatePerson(Person p) throws Exception

Answer: D Explanation:

The methods related directly to the entity Person is moved to a new class. CRUD

Note:DAO Design Pattern

*Abstracts and encapsulates all access to a data source *Manages the connection to the data source to obtain

and store data *Makes the code independent of the data sources and data vendors (e.g. plain-text, xml, LDAP,

Ensurepass 2018 PDF and VCE

MySQL, Oracle, DB2)

D:\Documents and Settings\useralbo\Desktop\1.jpg Example (here Customer is the main entity):

public class Customer { private final String id; private String contactName; private String phone;

public void setId(String id) { this.id = id; } public String getId() { return this.id; }

public void setContactName(String cn) { this.contactName = cn;} public String getContactName() { return

this.contactName; } public void setPhone(String phone) { this.phone = phone; } public String getPhone()

{ return this.phone; }


public interface CustomerDAO {

public void addCustomer(Customer c) throws DataAccessException; public Customer getCustomer(String id)

throws DataAccessException; public List getCustomers() throws DataAccessException; public void

removeCustomer(String id) throws DataAccessException; public void modifyCustomer(Customer c) throws

DataAccessException; } 57

Question No: 20


Ensurepass 2018 PDF and VCE

Which three are true?

  1. BasicCar uses composition.

  2. SuperCar uses composition.

  3. BasicCar is-a Car.

  4. SuperCar is-a Car.

  5. SuperCar takes advantage of polymorphism

  6. BasicCar has-a Car

Answer: B,C,E Explanation:

B: The relationship modeled by composition is often referred to as the quot;has-aquot; relationship. Here SuperCarhas-a Car.

C:The relationship modeled by inheritance is often referred to as the quot;is-aquot; relationship. Modeling an is-arelationship is called inheritance because the subclass inherits the interface and, by default, theimplementation of the superclass. Inheritance of interface guarantees that a subclass can accept all the samemessages as its superclass. A subclass object can, in fact, be used anywhere a superclass object is called for.E:The polymorphic method call allows one type to express its distinction from another, similar type, as long asthey#39;re both derived from the same base type. This distinction is expressed through differences in behavior ofthe methods that you can call through the base class.

100% Ensurepass Free Download!
Download Free Demo:1z0-804 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2018 EnsurePass 1z0-804 Full Exam PDF and VCE

EnsurePass ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

Leave a Reply

Your email address will not be published. Required fields are marked *