menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
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 capital) - Write a 3-arg
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 and Technology
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 and Technology
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 and Technology
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
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
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!
Disadvantages of using animation in advertising? advantages and disadvantages of using animation for education? advantages and disadvantages of using animation in entertainment?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org