www.HadoopExam.com

HadoopExam Learning Resources

Following are the Oracle Java and Oracle SQL Products Provided by HadoopExam Learning Resources
Free Core Java 1Z0-808 Training Java 1Z0-808 Questions and Answers Java 1Z0-809 Questions and Answers Questions for Oracle 1Z0-060 : Upgrade to Oracle Database 12c Administrator Oracle Database 12c: SQL Fundamentals

Question 7: You have been given below code, what is the expected behavior?

Question 7: You have been given below code, what is the expected behavior?

package com.hadoopexam;

import java.util.Locale;

class Welcome {

public static void main(String[] args) {

Locale locale = new Locale("quick", "Hadoop"); 

System.out.println(locale);

}

}

1. It will give compile time error.

2. It will give runtime error.

3. It will compile and run but no output.

4. It will give NullPointer Exception at run time

5. It will produce output as  "quick_HADOOP"

Correct Answer : 5 Exp : java.util.Locale.Locale(String language, String country)

Construct a locale from language and country. This constructor normalizes the language value to lowercase and the country value to uppercase. 

Note: 

.ISO 639 is not a stable standard; some of the language codes it defines (specifically "iw", "ji", and "in") have changed. This constructor accepts both the old codes ("iw", "ji", and "in") and the new codes ("he", "yi", and "id"), but all other API on Locale will return only the OLD codes. 

.For backward compatibility reasons, this constructor does not make any syntactic checks on the input. 

Parameters:

language An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length. See the Locale class description about valid language values.

country An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code. See the Locale class description about valid country values.

Throws:

NullPointerException - thrown if either argument is null.

The toString() method of Locale class returns a string representation of the Locale object consisting of language, country, variant

I have cleared my Java 1Z0-808 Certification exam with 92% using this simulator

 

I have cleared my Java 1Z0-809 Certification exam with 96% using this simulator

You have no rights to post comments

You are here: Home Oracle Java 1Z0-809 Question 7: You have been given below code, what is the expected behavior?