Question
JAVA Data Structures class please see below thank you! _________________________________________________________________ 1) You are given a file whose first few lines look like this Madagascar 226658.3
JAVA Data Structures class please see below thank you!
_________________________________________________________________
1) You are given a file whose first few lines look like this Madagascar 226658.3 Cyprus 3572.5 Sri Lanka 25330.1
Every island is represented by 2 lines. the first is the name and the second is the area. Write a java class called IslandReader with the following features: -Instance variable BufferedReader br -A constructor Island(BufferedReader br) that stores its arg in the br instance variable. Assume that whenever this constructor is called, br is connected to a correctly structured island file like the one above with of unknown length -A method public Island readIsland() throws IOException which reads 2 lines from the buffered reader and returns the instance of Island. The method should return null when it reaches the end of file.
2) Write the following method for the Island class: ArrayList
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started