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

2018 Jan Oracle Official New Released 1z0-804
100% Free Download! 100% Pass Guaranteed!

Java SE 7 Programmer II

Question No: 41


Ensurepass 2018 PDF and VCE

What is the result?

  1. Nice to see you,be fine

  2. Nice,see you,be fine

  3. Nice,see you, to, be fine

  4. Nice, see you, be fine

  5. Nice to see y, u, be fine

Answer: A Explanation:

The text quot;,to,quot; is replaced by the quot;,quot;

Question No: 42


Ensurepass 2018 PDF and VCE

What is the result?

  1. There are 27 sports cars and 5 trucks

  2. There are 27 convertibles and 5 trucks

  3. There are 9 sports cars and 5 trucks

  4. There are 9 convertibles and 5 trucks

  5. IllegalFormatConversionException is thrown at runtime

Answer: C Explanation:

Strings are immutable, therefore no change at line: svar.replace(svar,quot;convertiblesquot;); Format String Syntax:


The optional argument_index is a decimal integer indicating the position of the argument in the argument list.

The first argument is referenced by quot;1$quot;, the second by quot;2$quot;, etc.

The optional flags is a set of characters that modify the output format. The set of valid flags depends on theconversion.

#39;s#39;, #39;S#39; general

#39;d#39; integral The result is formatted as a decimal / integer

Question No: 43

Given the code fragment:

Ensurepass 2018 PDF and VCE

What is the result?

  1. Java 7

  2. Java 6

  3. Java 7, Java 6

  4. Java 7 java 6

  5. Java

Answer: C Explanation:

regex: Java / one or more anything !!! / ends with a digit so it is the source string

Question No: 44


Ensurepass 2018 PDF and VCE

What is the result?

  1. Pastel Enamel Fresco Gouache

  2. Pastel

    *Enamel Fresco


  3. Pastel Enamel Fresco Gouache

  4. Pastel Enamel, Fresco Gouache

Answer: B Explanation: regex explanation:

, = ,

\ = masks the following

\s = A whitespace character: [ \t \n \x0B \f \r ]

* = Greedy Quantifier: zero or more times

Delimiter: comma zero or more whitespace characters

Question No: 45


Ensurepass 2018 PDF and VCE

And the commands: javac Test.java

java ea Test

What is the result?

  1. Compilation fails

  2. Standard Edition Enterprise Edition Micro Edition

  3. Standard Edition

    class java.lang.AssertionError Micro Edition

  4. Standard Edition is printed and an Assertion Error is thrown

Answer: D Explanation: javac Test.java

will compile the program. As for command line: java ea Test

First the code will produce the output: Standard Edition

See Note below.

The ea option will enable assertions. This will make the following line in the switch statement to be run:

default: assert false;

This will throw an assertion error. This error will be caught. An the class of the assertion error (classjava.lang.AssertionError) will be printed by the following line: System.out.println(e.getClass());

Note:The java tool launches a Java application. It does this by starting a Java runtime environment, loading aspecified class, and invoking that class#39;s main method. The method declaration must look like the following:

public static void main(String args[]) Paramater ea:

-enableassertions[:lt;package namegt;quot;…quot; | :lt;class namegt; ] -ea[:lt;package namegt;quot;…quot; |

:lt;class namegt; ]

Enable assertions. Assertions are disabled by default. With no arguments, enableassertions or -ea enablesassertions.

Note 2:

An assertion is a statement in the JavaTM programming language that enables you to test your assumptionsabout your program.

Each assertion contains a boolean expression that you believe will be true when the assertion executes. If it isnot true, the system will throw an error.

public class AssertionError extends Error Thrown to indicate that an assertion has failed. Note 3:

The javac command compiles Java source code into Java bytecodes. You then use the Java interpreter – the

java command – to interprete the Java bytecodes. Reference:java – the Java application launcher

Reference:java.langClass AssertionError

Question No: 46


Ensurepass 2018 PDF and VCE

And the command-line invocation: Java Tracker 12 11

What is the result?

  1. General category

  2. class InvalidAgeException

  3. class java.lang.IllegalArgumentException

  4. class java.lang.RuntimeException

Answer: B Explanation:

The second argument 11 makes the program to throw an InvalidAgeException due to the line:

if (age lt; 12)

throw new InvalidAgeException ();

Question No: 47

Given the code fragment:

Ensurepass 2018 PDF and VCE

What is the result when infected() is invoked?

  1. before try catch finally after

  2. before catch finally after

  3. before catch after

  4. before catch finally

  5. before catch

Answer: D Explanation:

The following line throws and exception: int i = 1/0;

This exception is caught by: catch(Exception e) { System.out.print(quot;catch quot;); throw e;

Lastly, the finally statement is run as the finally block always executes when the try block exits. This ensuresthat the finally block is executed even if an unexpected exception occurs.

Reference: Java Tutorial,The finally Block

Question No: 48

Given the existing destination file, a source file only 1000 bytes long, and the code fragment:

Ensurepass 2018 PDF and VCE

What is the result?

  1. Overrides the content of the destination file with the source file content

  2. Appends the content of the source file to the destination file after a new line

  3. Appends the content of the source file to the destination file without a break in the flow

  4. Throws a runtime exception at line***

Answer: A Explanation:

The whole of the FileInputStream will be read (see ** below).

The content of the FileInputStream will overwrite the destination file (see *** below).

*A FileInputStream obtains input bytes from a file in a file system. What files are available depends on the host environment.

FileInputStream is meant for reading streams of raw bytes such as image data. For reading streams of characters, consider using FileReader.

**FileInputStream.read(byte[] b)

Reads up to b.length bytes of data from this input stream into an array of bytes. Parameters:

b – the buffer into which the data is read.

Returns:the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has beenreached.


You can construct a FileOutputStream object by passing a string containing a path name or a File object.

You can also specify whether you want to append the output to an existing file. public FileOutputStream (String path)

public FileOutputStream (String path, boolean append) public FileOutputStream (File file)

public FileOutputStream (File file, boolean append)

With the first and third constructors, if a file by the specified name already exists, the file will be overwritten.

To append to an existing file, pass true to the second or fourth constructor. Reference:Class FileInputStream

Reference:Class FileOutputStream

Question No: 49

Given the code fragment:

Ensurepass 2018 PDF and VCE

What is the result, if the file myfile.txt does not exist?

  1. A runtime exception is thrown at line 4

  2. A runtime exception is thrown at line 7

  3. Creates a new file and prints no output

  4. Compilation fails

Answer: D Explanation:

!! Compilation fails if FileNotFoundException is tried to catch (Line 12)

(The exception FileNotFoundException is already caught by the alternative IOException)


if this is removed will be thrown a FileNotFoundException at line 4.

Question No: 50

Given the code fragment:

Ensurepass 2018 PDF and VCE

What is the result, if the file salesreport.dat does not exist?

  1. Compilation fails only at line 6

  2. Compilation fails only at line 13

  3. Compilation fails at line 6 and 13

  4. Class java.io.IOException

  5. Class java.io.FileNotFoundException

Answer: B Explanation:

Compilation fails Line 13 : The resource br of a try-with-resources statement cannot be assignedresources are final in try-with-resources statements

100% Free Download!
Download Free Demo:1z0-804 Demo PDF
100% Pass 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

2018 EnsurePass IT Certification PDF and VCE

Leave a Comment


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