menu
Qammunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
To be done in Java - Create a class called Country.java. - Instance variables include name (String), capital (String), and population (an int representing the population of the …
Ask a Question
Questions
Unanswered
Tags
Ask a Question
To be done in Java - Create a class called Country.java. - Instance variables include name (String), capital (String), and population (an int representing the population of the …
asked
Sep 22, 2024
29.4k
views
3
votes
To be done in Java
- Create a class called Country.java.
- Instance variables include name (String), capital (String), and population (an int representing the population of the capital)
- Write a 3-arg constructor
- Write 3 accessor methods
- Write a toString method that returns the state/value of all instance variables.
- Test out your class:
- Step 1: Create an ArrayList of five countries.
- Step 2: Print out your ArrayList.
- Step 3: Remove one of the countries.
- Step 4: Print out your ArrayList again.
- Step 5: Create a new country and insert it in the middle of your ArrayList.
- Step 7: Print out your ArrayList again.
- Step 8: Change your last country to the country you removed in Step 3.
- Step 9: Print out your ArrayList again.
Computers & Tech
college
Tom Nijs
asked
by
Tom Nijs
7.8k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
4
votes
i dont why i cant post it here.
check the comment section.
Rijin
answered
Sep 26, 2024
by
Rijin
8.2k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Dec 11, 2024
16.6k
views
Create a class called Country.java. - Instance variables include name (String), capital (String), and population (an int representing the population of the capital) - Write a 3-arg constructor - Write
Hardy Mathew
asked
Dec 11, 2024
by
Hardy Mathew
7.9k
points
Computers & Tech
college
1
answer
4
votes
16.6k
views
asked
Oct 15, 2024
119k
views
Define the EvenNumber class for representing an even number. The class contains: A data field value of the int type that represents the integer value stored in the object. A no-arg constructor that creates
Krish
asked
Oct 15, 2024
by
Krish
7.8k
points
Engineering
college
1
answer
5
votes
119k
views
asked
Dec 24, 2024
39.0k
views
Define an inheritance relationship of a class Sphere in Java which is an inherited subclass of a Circle . Circle class contain a constructor with no arg and a constructor with double: radius, string class.
DoTheEvo
asked
Dec 24, 2024
by
DoTheEvo
8.5k
points
Computers & Tech
high-school
1
answer
0
votes
39.0k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.4m
questions
12.2m
answers
Categories
All categories
Mathematics
(3.7m)
History
(955k)
English
(903k)
Biology
(716k)
Chemistry
(440k)
Physics
(405k)
Social Studies
(564k)
Advanced Placement
(27.5k)
SAT
(19.1k)
Geography
(146k)
Health
(283k)
Arts
(107k)
Business
(468k)
Computers & Tech
(195k)
French
(33.9k)
German
(4.9k)
Spanish
(174k)
Medicine
(125k)
Law
(53.4k)
Engineering
(74.2k)
Other Questions
“What does it mean when we “rework” copyrighted material?”
Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to put it in my own words because my English is not that good!
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qammunity.org