Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define class Continent that has two instance variables name and numberOfCountries . Define three overloaded constructor methods: no-argument constructor (receives no name and no numberOfCountries),

Define class Continent that has two instance variables name and numberOfCountries. Define three overloaded constructor methods: no-argument constructor (receives no name and no numberOfCountries), one-argument constructor (receives only name) and two-argument constructor (receives name and numberOfCountries). Additionally, define all sets and gets methods. In the main method, define three objects of class Continent and test the three constructors and print all information of the continent that has largest number of countries. The number of countries in each continent is shown in the following table.

Continent

Number of countries

1

Asia

50

2

Africa

54

3

North America

23

4

South America

12

5

Antarctica

0

6

Europe

51

7

Autralia

14

Note: Inside the main method, write a line to greet the user by printing a message that has your name on it. Example: Hello! My name is ali turki . If you do not do this you will get ZERO.

Post a copy of your complete code inside the box below:

Post a screen-shot of the codes output inside the box below:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago