Define a class called Country. A Country has populationSize, area, capital, currency, and abbreviation (2-3 letters taken from the country name). Define at least two constructors, at least two getter methods, at least two setter methods, and Override the toString() method and the equals() method. The equals() method must return true if the two countries have the same name and same area and false otherwise. 1) Write a main method, define an array of country objects 2) Display countries whose populationSize is greater than one million.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Define a class called Country. A Country has populationSize, area, capital, currency, and abbreviation (2-3 letters taken from the country name). Define at least two constructors, at least two getter methods, at least two setter methods, and Override the toString() method and the equals() method. The equals() method must return true if the two countries have the same name and same area and false otherwise.
1) Write a main method, define an array of country objects
2) Display countries whose populationSize is greater than one million.
Step by step
Solved in 4 steps with 3 images