public class Country
extends java.lang.Object
Constructor and Description |
---|
Country(java.lang.String name,
java.lang.String capital,
int pop)
Construct an instance having the given parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCapital()
The capital name accessor.
|
java.lang.String |
getName()
The country name accessor.
|
int |
getPop()
The population accessor.
|
java.lang.String |
toString()
Construct a textual representation of the instance.
|
public Country(java.lang.String name, java.lang.String capital, int pop)
name
- the country namecapital
- the capital city namepop
- the population of the capitalpublic java.lang.String getName()
public java.lang.String getCapital()
public int getPop()
public java.lang.String toString()
toString
in class java.lang.Object