SlideShare a Scribd company logo
Implement these classes and a interface in 3 Java programs: Class 1: Track(String trackName,
String[] musicians, int durSecs) - The constructor creates a track object. String gettrackName() -
Accessor for the track name String[] getMusicians() - Accessor for the list of musicians int
getDurSecs() - Accessor for the duration of the track Class 2: InfTracklist(String trackName) --
Create a track list with the given name String gettrackName() - Return the name of the track list
int num() -- Return the number of tracks in the track list Track start() - Return the current track,
and then move the current track to the next item in the list (plays current track, then moves to the
next track) void add(Track track) - Add a new track to be the next track The track list works with
an iterator interface called TrackIterator, so that the user can move forward or backwards
through the list without changing the currently playing track. The track list exports these public
methods that use an iterator. TrackIterator iterator() - This returns an instance of a TrackIterator
starting from the current track. void reset(TrackIterator it) - Set playback to start from the track
pointed to by the track iterator void remove(TrackIterator it) - Remove the track pointed to by
the iterator. If the current track is pointed to by the iterator, set it to the next track, or null if there
are no more tracks. TrackIterator: The TrackIterator interface represents an iterator that allows
you to move through the list from the current point. The Zune uses this to allow you to move
through tracks forwards and backwards. The iterator's abstract methods are: Track current() --
Get the current track that the iterator is pointing to void next() - Advance the iteration void
previous() - Move backwards in the iteration Since the iterator is defined as an interface in
TrackIterator.java, you have to provide a concrete implementation of this interface for your
iterator. Provide your own concrete class that implements TrackIterator. Create your iterator
implementation as a (non-public) class inside InfTracklist.java. Call it anything you want.
Stylistically, a lot of people append "Impl" to their classes that implement an interface, so you
could call it TrackIteratorImpl, for example. Casting is the process of converting one type to
another. In the program, the InfTracklist.remove(TrackIterator it) method takes a TrackIterator as
an argument. That's great, except that TrackIterator is an interface. You really need the class that
implements the TrackIterator, which is TrackIteratorImpl. However the argument is of type
TrackIterator. So how do we change a TrackIterator to a TrackIteratorImpl? Inside the remove
function, we can cast it, like this: TrackIteratorImpl itImpl = (TrackIteratorImpl) it Now we have
a itImpl variable that we can use.

More Related Content

Similar to Implement these classes and a interface in 3 Java programs- Class 1- T.docx

9781439035665 ppt ch08
9781439035665 ppt ch089781439035665 ppt ch08
9781439035665 ppt ch08Terry Yoast
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
BG Java EE Course
 
unit-3java.pptx
unit-3java.pptxunit-3java.pptx
unit-3java.pptx
sujatha629799
 
Linked list (java platform se 8 )
Linked list (java platform se 8 )Linked list (java platform se 8 )
Linked list (java platform se 8 )
charan kumar
 
Boost your craftsmanship with Java 8
Boost your craftsmanship with Java 8Boost your craftsmanship with Java 8
Boost your craftsmanship with Java 8
João Nunes
 
Lambda Functions in Java 8
Lambda Functions in Java 8Lambda Functions in Java 8
Lambda Functions in Java 8
Ganesh Samarthyam
 
Java8: what's new and what's hot
Java8: what's new and what's hotJava8: what's new and what's hot
Java8: what's new and what's hot
Sergii Maliarov
 
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
Akaks
 
Java 8 Feature Preview
Java 8 Feature PreviewJava 8 Feature Preview
Java 8 Feature Preview
Jim Bethancourt
 
Apache Flink Training: DataStream API Part 2 Advanced
Apache Flink Training: DataStream API Part 2 Advanced Apache Flink Training: DataStream API Part 2 Advanced
Apache Flink Training: DataStream API Part 2 Advanced
Flink Forward
 
Functions in advanced programming
Functions in advanced programmingFunctions in advanced programming
Functions in advanced programming
VisnuDharsini
 
Concurrent talk
Concurrent talkConcurrent talk
Concurrent talkrahulrevo
 
The implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdfThe implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdf
birajdar2
 
RxJava2 Slides
RxJava2 SlidesRxJava2 Slides
RxJava2 Slides
YarikS
 
Array list (java platform se 8 )
Array list (java platform se 8 )Array list (java platform se 8 )
Array list (java platform se 8 )
charan kumar
 
819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdf819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdf
meenaaarika
 
File Input and output.pptx
File Input  and output.pptxFile Input  and output.pptx
File Input and output.pptx
cherryreddygannu
 
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
sachin kumar
 
Files streams..
Files streams..Files streams..
Files streams..
vinodhinis7
 

Similar to Implement these classes and a interface in 3 Java programs- Class 1- T.docx (20)

9781439035665 ppt ch08
9781439035665 ppt ch089781439035665 ppt ch08
9781439035665 ppt ch08
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
 
unit-3java.pptx
unit-3java.pptxunit-3java.pptx
unit-3java.pptx
 
Linked list (java platform se 8 )
Linked list (java platform se 8 )Linked list (java platform se 8 )
Linked list (java platform se 8 )
 
Boost your craftsmanship with Java 8
Boost your craftsmanship with Java 8Boost your craftsmanship with Java 8
Boost your craftsmanship with Java 8
 
Lambda Functions in Java 8
Lambda Functions in Java 8Lambda Functions in Java 8
Lambda Functions in Java 8
 
Chap08
Chap08Chap08
Chap08
 
Java8: what's new and what's hot
Java8: what's new and what's hotJava8: what's new and what's hot
Java8: what's new and what's hot
 
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
 
Java 8 Feature Preview
Java 8 Feature PreviewJava 8 Feature Preview
Java 8 Feature Preview
 
Apache Flink Training: DataStream API Part 2 Advanced
Apache Flink Training: DataStream API Part 2 Advanced Apache Flink Training: DataStream API Part 2 Advanced
Apache Flink Training: DataStream API Part 2 Advanced
 
Functions in advanced programming
Functions in advanced programmingFunctions in advanced programming
Functions in advanced programming
 
Concurrent talk
Concurrent talkConcurrent talk
Concurrent talk
 
The implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdfThe implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdf
 
RxJava2 Slides
RxJava2 SlidesRxJava2 Slides
RxJava2 Slides
 
Array list (java platform se 8 )
Array list (java platform se 8 )Array list (java platform se 8 )
Array list (java platform se 8 )
 
819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdf819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdf
 
File Input and output.pptx
File Input  and output.pptxFile Input  and output.pptx
File Input and output.pptx
 
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
 
Files streams..
Files streams..Files streams..
Files streams..
 

More from Blake0FxCampbelld

In C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docxIn C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docx
Blake0FxCampbelld
 
In Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docx
In Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docxIn Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docx
In Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docx
Blake0FxCampbelld
 
In a Word document- you will need to list and define all key terms wit.docx
In a Word document- you will need to list and define all key terms wit.docxIn a Word document- you will need to list and define all key terms wit.docx
In a Word document- you will need to list and define all key terms wit.docx
Blake0FxCampbelld
 
In a survey of 2918 adults- 1477 say they have started paying bills on.docx
In a survey of 2918 adults- 1477 say they have started paying bills on.docxIn a survey of 2918 adults- 1477 say they have started paying bills on.docx
In a survey of 2918 adults- 1477 say they have started paying bills on.docx
Blake0FxCampbelld
 
In a population of yellow mushrooms- a mutation resulted in a new purp (1).docx
In a population of yellow mushrooms- a mutation resulted in a new purp (1).docxIn a population of yellow mushrooms- a mutation resulted in a new purp (1).docx
In a population of yellow mushrooms- a mutation resulted in a new purp (1).docx
Blake0FxCampbelld
 
In a particular hospital- 5 newborn babies were delivered yesterday- H.docx
In a particular hospital- 5 newborn babies were delivered yesterday- H.docxIn a particular hospital- 5 newborn babies were delivered yesterday- H.docx
In a particular hospital- 5 newborn babies were delivered yesterday- H.docx
Blake0FxCampbelld
 
In a paper written by Bendey Coliege econonists Patricia M- Flynn and.docx
In a paper written by Bendey Coliege econonists Patricia M- Flynn and.docxIn a paper written by Bendey Coliege econonists Patricia M- Flynn and.docx
In a paper written by Bendey Coliege econonists Patricia M- Flynn and.docx
Blake0FxCampbelld
 
In a given population of Drosophila- curly wings (c) is recessive to t.docx
In a given population of Drosophila- curly wings (c) is recessive to t.docxIn a given population of Drosophila- curly wings (c) is recessive to t.docx
In a given population of Drosophila- curly wings (c) is recessive to t.docx
Blake0FxCampbelld
 
In a large population- 51- of the people have been vaccinated- If 4 pe.docx
In a large population- 51- of the people have been vaccinated- If 4 pe.docxIn a large population- 51- of the people have been vaccinated- If 4 pe.docx
In a large population- 51- of the people have been vaccinated- If 4 pe.docx
Blake0FxCampbelld
 
In a geographic isolate- a small population has been studied for a gen.docx
In a geographic isolate- a small population has been studied for a gen.docxIn a geographic isolate- a small population has been studied for a gen.docx
In a geographic isolate- a small population has been studied for a gen.docx
Blake0FxCampbelld
 
In a democracy- politicians may be shortsighted because they want to w.docx
In a democracy- politicians may be shortsighted because they want to w.docxIn a democracy- politicians may be shortsighted because they want to w.docx
In a democracy- politicians may be shortsighted because they want to w.docx
Blake0FxCampbelld
 
In a certain city- the daily consumption of water (in millions of lite.docx
In a certain city- the daily consumption of water (in millions of lite.docxIn a certain city- the daily consumption of water (in millions of lite.docx
In a certain city- the daily consumption of water (in millions of lite.docx
Blake0FxCampbelld
 
In a certain geographic location 15- of individuals have disease A- 15.docx
In a certain geographic location 15- of individuals have disease A- 15.docxIn a certain geographic location 15- of individuals have disease A- 15.docx
In a certain geographic location 15- of individuals have disease A- 15.docx
Blake0FxCampbelld
 
In 2014- the General Social Survey incuded a question about the role o.docx
In 2014- the General Social Survey incuded a question about the role o.docxIn 2014- the General Social Survey incuded a question about the role o.docx
In 2014- the General Social Survey incuded a question about the role o.docx
Blake0FxCampbelld
 
In 1993- when Fischer began his tenure at Kodak- the film industry was.docx
In 1993- when Fischer began his tenure at Kodak- the film industry was.docxIn 1993- when Fischer began his tenure at Kodak- the film industry was.docx
In 1993- when Fischer began his tenure at Kodak- the film industry was.docx
Blake0FxCampbelld
 
In search engines analyzes the sequences of search queries to identif.docx
In  search engines analyzes the sequences of search queries to identif.docxIn  search engines analyzes the sequences of search queries to identif.docx
In search engines analyzes the sequences of search queries to identif.docx
Blake0FxCampbelld
 
import os import matplotlib-pyplot as plt import pandas as pd import r.docx
import os import matplotlib-pyplot as plt import pandas as pd import r.docximport os import matplotlib-pyplot as plt import pandas as pd import r.docx
import os import matplotlib-pyplot as plt import pandas as pd import r.docx
Blake0FxCampbelld
 
import java-util--- import java-io--- class Vertex { -- Constructo.docx
import java-util--- import java-io---   class Vertex {   -- Constructo.docximport java-util--- import java-io---   class Vertex {   -- Constructo.docx
import java-util--- import java-io--- class Vertex { -- Constructo.docx
Blake0FxCampbelld
 
Implement the Plates class buildMap function so that it populates the.docx
Implement the Plates class buildMap function so that it populates the.docxImplement the Plates class buildMap function so that it populates the.docx
Implement the Plates class buildMap function so that it populates the.docx
Blake0FxCampbelld
 
Implementing AES- Native Instructions (AES-NI) is faster than other im.docx
Implementing AES- Native Instructions (AES-NI) is faster than other im.docxImplementing AES- Native Instructions (AES-NI) is faster than other im.docx
Implementing AES- Native Instructions (AES-NI) is faster than other im.docx
Blake0FxCampbelld
 

More from Blake0FxCampbelld (20)

In C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docxIn C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docx
 
In Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docx
In Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docxIn Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docx
In Arevalo- Aravind- Ayuso and Roca's (2013) article- we learn that th.docx
 
In a Word document- you will need to list and define all key terms wit.docx
In a Word document- you will need to list and define all key terms wit.docxIn a Word document- you will need to list and define all key terms wit.docx
In a Word document- you will need to list and define all key terms wit.docx
 
In a survey of 2918 adults- 1477 say they have started paying bills on.docx
In a survey of 2918 adults- 1477 say they have started paying bills on.docxIn a survey of 2918 adults- 1477 say they have started paying bills on.docx
In a survey of 2918 adults- 1477 say they have started paying bills on.docx
 
In a population of yellow mushrooms- a mutation resulted in a new purp (1).docx
In a population of yellow mushrooms- a mutation resulted in a new purp (1).docxIn a population of yellow mushrooms- a mutation resulted in a new purp (1).docx
In a population of yellow mushrooms- a mutation resulted in a new purp (1).docx
 
In a particular hospital- 5 newborn babies were delivered yesterday- H.docx
In a particular hospital- 5 newborn babies were delivered yesterday- H.docxIn a particular hospital- 5 newborn babies were delivered yesterday- H.docx
In a particular hospital- 5 newborn babies were delivered yesterday- H.docx
 
In a paper written by Bendey Coliege econonists Patricia M- Flynn and.docx
In a paper written by Bendey Coliege econonists Patricia M- Flynn and.docxIn a paper written by Bendey Coliege econonists Patricia M- Flynn and.docx
In a paper written by Bendey Coliege econonists Patricia M- Flynn and.docx
 
In a given population of Drosophila- curly wings (c) is recessive to t.docx
In a given population of Drosophila- curly wings (c) is recessive to t.docxIn a given population of Drosophila- curly wings (c) is recessive to t.docx
In a given population of Drosophila- curly wings (c) is recessive to t.docx
 
In a large population- 51- of the people have been vaccinated- If 4 pe.docx
In a large population- 51- of the people have been vaccinated- If 4 pe.docxIn a large population- 51- of the people have been vaccinated- If 4 pe.docx
In a large population- 51- of the people have been vaccinated- If 4 pe.docx
 
In a geographic isolate- a small population has been studied for a gen.docx
In a geographic isolate- a small population has been studied for a gen.docxIn a geographic isolate- a small population has been studied for a gen.docx
In a geographic isolate- a small population has been studied for a gen.docx
 
In a democracy- politicians may be shortsighted because they want to w.docx
In a democracy- politicians may be shortsighted because they want to w.docxIn a democracy- politicians may be shortsighted because they want to w.docx
In a democracy- politicians may be shortsighted because they want to w.docx
 
In a certain city- the daily consumption of water (in millions of lite.docx
In a certain city- the daily consumption of water (in millions of lite.docxIn a certain city- the daily consumption of water (in millions of lite.docx
In a certain city- the daily consumption of water (in millions of lite.docx
 
In a certain geographic location 15- of individuals have disease A- 15.docx
In a certain geographic location 15- of individuals have disease A- 15.docxIn a certain geographic location 15- of individuals have disease A- 15.docx
In a certain geographic location 15- of individuals have disease A- 15.docx
 
In 2014- the General Social Survey incuded a question about the role o.docx
In 2014- the General Social Survey incuded a question about the role o.docxIn 2014- the General Social Survey incuded a question about the role o.docx
In 2014- the General Social Survey incuded a question about the role o.docx
 
In 1993- when Fischer began his tenure at Kodak- the film industry was.docx
In 1993- when Fischer began his tenure at Kodak- the film industry was.docxIn 1993- when Fischer began his tenure at Kodak- the film industry was.docx
In 1993- when Fischer began his tenure at Kodak- the film industry was.docx
 
In search engines analyzes the sequences of search queries to identif.docx
In  search engines analyzes the sequences of search queries to identif.docxIn  search engines analyzes the sequences of search queries to identif.docx
In search engines analyzes the sequences of search queries to identif.docx
 
import os import matplotlib-pyplot as plt import pandas as pd import r.docx
import os import matplotlib-pyplot as plt import pandas as pd import r.docximport os import matplotlib-pyplot as plt import pandas as pd import r.docx
import os import matplotlib-pyplot as plt import pandas as pd import r.docx
 
import java-util--- import java-io--- class Vertex { -- Constructo.docx
import java-util--- import java-io---   class Vertex {   -- Constructo.docximport java-util--- import java-io---   class Vertex {   -- Constructo.docx
import java-util--- import java-io--- class Vertex { -- Constructo.docx
 
Implement the Plates class buildMap function so that it populates the.docx
Implement the Plates class buildMap function so that it populates the.docxImplement the Plates class buildMap function so that it populates the.docx
Implement the Plates class buildMap function so that it populates the.docx
 
Implementing AES- Native Instructions (AES-NI) is faster than other im.docx
Implementing AES- Native Instructions (AES-NI) is faster than other im.docxImplementing AES- Native Instructions (AES-NI) is faster than other im.docx
Implementing AES- Native Instructions (AES-NI) is faster than other im.docx
 

Recently uploaded

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

Implement these classes and a interface in 3 Java programs- Class 1- T.docx

  • 1. Implement these classes and a interface in 3 Java programs: Class 1: Track(String trackName, String[] musicians, int durSecs) - The constructor creates a track object. String gettrackName() - Accessor for the track name String[] getMusicians() - Accessor for the list of musicians int getDurSecs() - Accessor for the duration of the track Class 2: InfTracklist(String trackName) -- Create a track list with the given name String gettrackName() - Return the name of the track list int num() -- Return the number of tracks in the track list Track start() - Return the current track, and then move the current track to the next item in the list (plays current track, then moves to the next track) void add(Track track) - Add a new track to be the next track The track list works with an iterator interface called TrackIterator, so that the user can move forward or backwards through the list without changing the currently playing track. The track list exports these public methods that use an iterator. TrackIterator iterator() - This returns an instance of a TrackIterator starting from the current track. void reset(TrackIterator it) - Set playback to start from the track pointed to by the track iterator void remove(TrackIterator it) - Remove the track pointed to by the iterator. If the current track is pointed to by the iterator, set it to the next track, or null if there are no more tracks. TrackIterator: The TrackIterator interface represents an iterator that allows you to move through the list from the current point. The Zune uses this to allow you to move through tracks forwards and backwards. The iterator's abstract methods are: Track current() -- Get the current track that the iterator is pointing to void next() - Advance the iteration void previous() - Move backwards in the iteration Since the iterator is defined as an interface in TrackIterator.java, you have to provide a concrete implementation of this interface for your iterator. Provide your own concrete class that implements TrackIterator. Create your iterator implementation as a (non-public) class inside InfTracklist.java. Call it anything you want. Stylistically, a lot of people append "Impl" to their classes that implement an interface, so you could call it TrackIteratorImpl, for example. Casting is the process of converting one type to another. In the program, the InfTracklist.remove(TrackIterator it) method takes a TrackIterator as an argument. That's great, except that TrackIterator is an interface. You really need the class that implements the TrackIterator, which is TrackIteratorImpl. However the argument is of type TrackIterator. So how do we change a TrackIterator to a TrackIteratorImpl? Inside the remove function, we can cast it, like this: TrackIteratorImpl itImpl = (TrackIteratorImpl) it Now we have a itImpl variable that we can use.