Oracle 1Z0-805 Free PDF Demo

Page 7

Question: 7

Given the code fragment: dataFormat df; Which statement defines a new DataFormat 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.getDataInstance (DataFormat.DEFAULT, Locale.UK); E. df = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale(UK));

Answer: C

Explanation: DateFormat is an abstract class that provides the ability to format and parse dates and times. The getDateInstance() method returns an instance of DateFormat that can format date information. It is available in these forms: static final DateFormat getDateInstance( ) static final DateFormat getDateInstance(int style) static final DateFormat getDateInstance(int style, Locale locale) The argument style is one of the following values: DEFAULT, SHORT, MEDIUM, LONG, or FULL. These are int constants defined by DateFormat. Incorrect answers: A, B, E: Incorrect syntax for the Locale. The correct syntax is: Locale.UK D: Incorrect syntax.

PassCertification.com- 1Z0-805 Exam Questions and Answers

6


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.