Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8428639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:06:43+00:00 2026-06-10T05:06:43+00:00

Hello ive added two new functions to the implementation of an interface. this is

  • 0

Hello ive added two new functions to the implementation of an interface.

this is the implementation file…

import au.edu.uow.Collection.Album;
import java.util.ArrayList;

public class CDAlbum implements Album {
    private String Title;
    private String Genre;
    private String Artist;
    private String MediaType;
    private ArrayList<String> trackList;

    public CDAlbum(String TempTitle, String TempGenre, String TempArtist, ArrayList<String> TempTracklist, String TempMediaType){
        //Set initail variable values
        Title = TempTitle;
        Genre = TempGenre;
        Artist = TempArtist;
        trackList = TempTracklist;
        MediaType = TempMediaType;
    }
    //Accessor Functions
    public String getMediaType(){
        //Return Media Type
        return MediaType;
    }
    public String getTitle(){
        //Return Title
        return Title;
    }
    public String getGenre(){
        //Return Genre
        return Genre;
    }
    public String getArtist(){
        //Return Artist
        return Artist;
    }
    public ArrayList<String> getTrackList(){
        //Return Tracklist
        return trackList;
    }
}

The bottom two functions are the added functions( getArtist(), getTrackList())
the problem im having is that when i try to call these functions from a class file it give me the following errors.

./au/edu/uow/UserInterface/UserInterface.java:95: cannot find symbol
symbol  : method getArtist()
location: interface au.edu.uow.Collection.Album
            System.out.println(albumCollection.get(number).getArtist());
                                                          ^
./au/edu/uow/UserInterface/UserInterface.java:98: cannot find symbol
symbol  : method getTrackList()
location: interface au.edu.uow.Collection.Album
            ArrayList<String> trackList = albumCollection.get(number).getTrackList();

When i call the functions

import au.edu.uow.Collection.Album;

System.out.println(albumCollection.get(number).getArtist());

//Access the track titles
ArrayList<String> trackList = albumCollection.get(number).getTrackList();
//Output collection
int arrayListSize = trackList.size();
for(int i = 0; i < arrayListSize; i++)
{
    System.out.println( i + ": " + trackList.get(i));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:06:45+00:00Added an answer on June 10, 2026 at 5:06 am

    Album specifies neither getArtist nor getTrackList:

    public interface Album {
        /**
         * This method returns the media type of the album. 
         * @return the media type of the album, either CD or DVD
         * @see #getTitle()
         * @see #getGenre()
         */
         String getMediaType();
    
        /**
         * This method returns the title of the album. 
         * @return the title of the album
         * @see #getMediaType()
         * @see #getGenre()
         */
         String getTitle();
    
        /**
         * This method returns the genre of the album. 
         * @return the genre of the album
         * @see #getTitle()
         * @see #getMediaType()
         */
        String getGenre();
    
    }
    

    … only CDAlbum does.

    You can determine whether the Album is a CDAlbum or DVDAlbum by checking Album.getMediaType; then, if it is a CD, you can cast to CDAlbum and invoke getArtist and getTrackList then.

    for (final Album album : albumCollection) {
      final String type = album.getMediaType();
      System.out.print(type + " album: " + album.getTitle()
          + " (" + album.getGenre() + ") - ");
      if (type.equals("CD")) {
        final CDAlbum cd = (CDAlbum) album;
        System.out.println(cd.getArtist());
        int n = 0;
        for (final String track : cd.getTrackList()) {
          System.out.printf("#%2d - %s\n", ++n, track);
        }
      } else {
        final DVDAlbum dvd = (DVDAlbum) album;
        System.out.println(dvd.getDirector());
        System.out.println(dvd.getPlotOutline());
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I've got this query to get users by email, which is an unique
Hello i' ve this problem with unicode emails, when i try to send words
I've added a button that I want to essentially toggle a label from Hello
I'm new to Google Apps and I've been messing around with the hello world
Hello I've just implemented a search option on my application use this on the
Hello I added a JQuery SlideShow with 6 png images each with the size
I've been trying to implement the tab UI described in this tutorial: https://developer.android.com/resources/tutorials/views/hello-tabwidget.html I
My problem is actually two-fold. First, I'm pretty new to EF but I've used
Hello I've recently added a weather widget for people to add to their site.
Hello I've got another question. I am creating an administration system. I added registration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.