IBM Study Guides - BraindumpsQA Microsoft Practice exam

http://www.braindumpsqa.com/VCP550_braindumps.html

1Z0-804 Test Study Guide & Java SE 7 Programmer II Exam

Valid 1Z0-804 Dumps shared by NewPassLeader for Helping Passing 1Z0-804 Exam! NewPassLeader now offer the newest 1Z0-804 exam dumps, the NewPassLeader 1Z0-804 exam questions have been updated and answers have been corrected get the newest NewPassLeader 1Z0-804 dumps with Test Engine here:
http://https://www.newpassleader.com/Oracle/1Z0-804-exam-preparation-materials.html (150 Q&As Dumps, 30%OFF Special Discount: 30free )


NEW QUESTION NO: 15
Given the code fragment:
DateFormat df;
Which statement defines a new Dateformat object that displays the default date format for the UK Locale?
A. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale (UK));
B. df = DateFormat.getDateInstance (DateFormat.DEFAULT, UK);
C. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK);
D. df = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK);
E. df = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale (UK));
Answer: C
Explanation/Reference:
Explanation:
The UK locale is constructed withLocale.UK.
To format a date for a different Locale, specify it in the call to getDateInstance(). DateFormat df
DateFormat.getDateInstance(DateFormat.LONG, Locale.FRANCE);
Note: getDateInstance( int style, Locale aLocale )
Gets the date formatter with the given formatting style for the given locale.
Reference:Class DateFormat

NEW QUESTION NO: 16
Given:
StringBuffer b = new StringBuffer("3");
System.out.print(5+4+b+2+1);
What is the result?
A. 54321
B. 9321
C. 5433
D. 933
E. Output is Similar to: 9java.lang.StringBuffer@100490121.
F. Compilation fails.
Answer: F
Explanation/Reference:
Explanation:
The code will not compile.
The print function cannot handle the mixture of integers and strings.
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type

NEW QUESTION NO: 17
Given the code fragment:
SimpleDataFormat sdf;
Which code fragment displays the three-character month abbreviation?
A. SimpleDateFormat sdf = new SimpleDateFormat ("MMM", Locale.UK); System.out.println ("Result:" +
sdf.format(new Date()));
B. SimpleDateFormat sdf = new SimpleDateFormat ("MMMM", Locale.UK); System.out.println ("Result:" +
sdf.format(new Date()));
C. SimpleDateFormat sdf = new SimpleDateFormat ("MM", Locale.UK); System.out.println ("Result:" +
sdf.format(new Date()));
D. SimpleDateFormat sdf = new SimpleDateFormat ("mm", Locale.UK); System.out.println ("Result:" +
sdf.format(new Date()));
Answer: A

NEW QUESTION NO: 18
Which type of ExecutorService supports the execution of tasks after a fixed delay?
A. DelayedExecutorService
B. ScheduledExecutorService
C. TimedExecutorService
D. FixedExecutorService
E. FutureExecutorService
Answer: B
Explanation/Reference:
Explanation:
The ScheduledExecutorService interface supplements the methods of its parent ExecutorService with
schedule, which executes a Runnable or Callable task after a specified delay. In addition, the interface
defines scheduleAtFixedRate and scheduleWithFixedDelay, which executes specified tasks repeatedly, at
defined intervals.
Note:The java.util.concurrent package defines three executor interfaces:
*Executor, a simple interface that supports launching new tasks. *ExecutorService, a subinterface of
Executor, which adds features that help manage the lifecycle, both of the individual tasks and of the
executor itself.
*ScheduledExecutorService, a subinterface of ExecutorService, supports future and/or periodic execution
of tasks.
Reference: The Java Tutorials,Executor Interfaces

NEW QUESTION NO: 19
Given the fragment:

Which two valid alternatives to line 3 would decouple this application from a specific implementation of
CustomerDAO?
A. CustomerDAO custDao = CustomerDAO();
B. CustomerDAO custDao = (CustomerDAO) new Object ();
C. CustomerDAO custDao = CustomerDAO.getInstance();
D. CustomerDAO custDao = (CustomerDAO) new CustomerDAOmemoryImp1();
E. CustomerDAO custDao = customerDAOFactory.getInstance();
Answer: C,E
Explanation/Reference:
Explanation:
Note: In software development, the term"decoupling"is used to identify the separation of software blocks
that shouldn't depend on each other. Some building blocks are generic and shouldn't know details of
others.
Special design techniques allow software designers to have as few dependencies as possible. This
typically reduces the risk of malfunction in one part of a system when the other part changed. It also forces
the developer to focus on one thing at a time.
Decoupling lowers or minimizes Coupling.

NEW QUESTION NO: 20
Given:

What is the result?
A. Compilation fails.
B. 78 class java.lang.Array.IndexOutOfBoundException
C. class MarkOutOfBoundException
D. class java.lang.arrayIndexOutOfBoundException
Answer: A
Explanation/Reference:
Explanation:
The exception MarkOutOfBoundsException is already caught by the alternative
ArrayIndexOutOfBoundsException

NEW QUESTION NO: 21
Given the code fragment:

What is the result when the result.txt file already exists in c:\student?
A. The program replaces the file contents and the file's attributes and prints Equal.
B. The program replaces the file contents as well as the file attributes and prints Not equal.
C. An UnsupportedOperationException is thrown at runtime.
D. The program replaces only the file attributes and prints Not equal.
Answer: B
Explanation/Reference:
Explanation:
Assuming there is a file D:\\faculty\\report.txt then this file will be copied and will be replacing
C:\\student\\report.txt.

NEW QUESTION NO: 22
Given that myfile.txt contains:

What is the result?
A. new file.txt contains:
1: First
2: Second
3: Third
B. new file.txt contains:
1: First 2: Second 3: Third
C. newfile.txt is empty
D. an exception is thrown at runtime
E. compilation fails
Answer: A
Explanation/Reference:
Explanation:
For each line in the file myfile.text the line number and the line is written into newfile.txt.

NEW QUESTION NO: 23
Given:

What is the result?
A. Null
B. class java.lang.ArraylndexOutOfBoundsException
C. class java.lang.NullPointerException
D. class java.lang.Exception
E. Compilation fails.
Answer: E
Explanation/Reference:
Explanation: error: incompatible types
e = new Exception();
required: RuntimeException
found: Exception

NEW QUESTION NO: 24
The default file system includes a logFiles directory that contains the following files:
Log-Jan 2009
log_0l_20l0
log_Feb20l0
log_Feb2011
log_10.2012
log-sum-2012
How many files does the matcher in this fragment match?
PathMatcher matcher = FileSystems.getDefault ().getPathMatcher ("glob: *???_*1?" );
A. One
B. Two
C. Three
D. Four
E. Five
F. Six
Answer: B
Explanation/Reference:
Explanation:
The pattern to match is *???_*1? (regex ".*..._.*1.")
This means at least three characters before the symbol _ , followed by any amount of characters. The next
to last character must be 1. The last character can by any character.
The following file names match this pattern:
log_Feb2011
log_10.2012
Trap !! l is not 1 !!

NEW QUESTION NO: 25
Given:

What is the result?
A. 1
B. 0
C. 2
D. Compilation fails
E. An exception is thrown at runtime
Answer: E
Explanation/Reference:
Explanation: The code compiles fine.
java.lang.NullPointerException
because only one element of list is initialized : element [0]
elements [1] and [2] equals null
alte Begründung:
An exception is thrown at runtime due to data type comparison mismatch:
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to
java.lang.Integer
at java.lang.Integer.compareTo(Integer.java:52)
at java.util.Arrays.binarySearch0(Arrays.java:1481)
at java.util.Arrays.binarySearch(Arrays.java:1423)
at searchtext.SearchText.main(SearchText.java:22)
Note:binarySearch
public static int binarySearch(char[] a,
char key) Searches the specified array of chars for the specified value using the binary search algorithm.
The array must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the
results are undefined. If the array contains multiple elements with the specified value, there is no
guarantee which one will be found.
Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
Index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is
defined as the point at which the key would be inserted into the list: the index of the first element greater
than the key, or list.size(), if all elements in the list are less than the specified key. Note that this
guarantees that the return value will be >= 0 if and only if the key is found.


Posted 2018/7/2 16:31:15  |  Category: Oracle  |  Tag: 1Z0-804 Test Study Guide1Z0-804 Reliable Exam Topics1Z0-804Oracle