Free 1Z0-804 Braindumps


  • Exam Number: 1Z0-804
  • Provider: Oracle
  • Questions: 150
  • Updated On: 17-Nov-2018

QUESTION: 1
Given the code fragment:

DataFormat df;

Which statement defines a new Dateformat object that displays the default date format for the
UK Locale?

A. df = DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale (UK));
B. df = DateFormat.getdatDataInstance (DateFormat.DEFAULT, UK);
C. df = DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale.UK);
D. df = new DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale.UK);
E. df = new DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale (UK));

Answer(s): C
Explanation:
The UK locale is constructed withLocale.UK.
Example:
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
QUESTION: 2
Given:

public class DoubleThread { public static void main(String[] args) { Thread t1 = new Thread()
{ public void run() {
System.out.print("Greeting");
}
};
Thread t2 = new Thread(t1); // Line 9
t2.run();
}
}
Which two are true?

A. A runtime exception is thrown on line 9.
B. No output is produced.
C. Greeting is printed once.
D. Greeting is printed twice.
E. No new threads of execution are started within the main method.
F. One new thread of execution is started within the main method.
G. Two new threads of execution are started within the main method.

Answer(s): C, E
Explanation:
Thread t2 is executed. Execution of T2 starts executionen of t1. Greeting is printed during the
execution of t1.
2


Get The Premium Version

Allbraindumps.com
 Test Questions PDF from Myitguides.com

 Test Questions PDF from Myitguides.com