Declare a class called country that contains a function called language that prints "English" Define 3 classes and they all inherit from country A brand named Australia A class named Saudi Rewrite the language function and change the implementation of the function so that it prints "Arabic" A class called Spain Rewrite the language function and change the implementation of the function so that it prints "Spanish" Build a Test class to test the code with the Main function and then create objects of the three classes that Workshop of the father's class Then call the language function The result should be as in the picture English Arabic Spanish

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

IN JAV
1. Declare a class called country that contains a function called language that prints "English"

Define 3 classes and they all inherit from country

A brand named Australia

A class named Saudi Rewrite the language function and change the implementation of the function so that it prints "Arabic"

A class called Spain Rewrite the language function and change the implementation of the function so that it prints "Spanish"

Build a Test class to test the code with the Main function and then create objects of the three classes that

Workshop of the father's class

Then call the language function

The result should be as in the picture

English

Arabic

Spanish

English
Arabic
Spanish
Transcribed Image Text:English Arabic Spanish
Expert Solution
Program

import java.util.*;
public class country
{
 public static void main(String[] args)
 {
  // Creating a new Locale
  Locale language1 = new Locale("English", "Australia");
  Locale language2 = new Locale("Arabic", "Saudi");
  Locale language3 = new Locale("Spanish", "Spain");

  // Use of getDefault() :
  Locale language2 = Locale.getDefault();

  System.out.println("Locale name : " + language1);
  System.out.println("Locale name Default : " + language2);

  // Use of getDisplayCountry() :
  System.out.println("\nCountry Name : "
       + language1.getDisplayCountry());

  // Use of getAvailableLocales()
  Locale[] language4 = Locale.getAvailableLocales();


  System.out.println("\nInstalled locales are : ");
  for (int i = 1; i < language4.length/10; i++)
   System.out.println(i + ":" + language4[i]);

  // Use of getDisplayLanguage() :
  System.out.println("\nlanguage2 Language : "
      + language2.getDisplayLanguage());

  // Use of getDisplayLanguage(Locale in) :
  System.out.println("Language of in Locale : "
  + language1.getDisplayLanguage(new Locale("France", "French")));

  // Use of getDisplayName :
  System.out.println("\nUse of getDisplayName : "
       + language1.getDisplayName());

  // Use of getDisplayName(Locale in) :
  System.out.println("Name of in Locale : "
  + language2.getDisplayName(new Locale("English", "english")));

 

 }
}

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education