1

This is in the main() method:

Movie[] list = new Movie[6];

list[0] = new Animated(.25, 700.000, "Mulan", "Barry Cook", 1998, 15.000);
list[1] = new Animated(.23, 45.000, "TMNT", "Steve Barron", 1990, 12.000);
list[2] = new Documentary(12, 7.000, "Nixon", "Oliver Stone", 1995, 50.000);
list[3] = new Documentary(10, 4.500, "JFK", "Oliver Stone", 1991, 35.000);
list[4] = new Drama(3.500, 8.25, "Belly", "Hype Williams", 1998, 20.000);
list[5] = new Drama(4.500, 9.00, "42", "Brian Helgeland", 2013, 16.000);

System.out.print(menu());
System.out.print("Select and menu option 1-5: ");
choice = input.nextInt();
do
{
    switch(choice)
    {
        case 1: movieList(list);
        break;

and I'm calling the movieList(list) method which exists within the class outside main:

public static void movieList(Movie[] a)
{
    System.out.printf("\n\n%-10s %-10s %-10s %-10s %-10s", "TITLE", "YEAR",
    "REVENUE", "PROFIT", "CATEGORY");
    System.out.printf("\n\n%-10s", Movie[0].getTitle());
}

This is the method I am calling in case 1, how I have been trying to use one Parameter and I get "cannot find symbol" error with the pointer at Movie. I have been searching and I am beginning to think I cannot access this value this way.

1 Answer 1

4

The name of your Movie[] parameter in your movieList method is a, so try using a[0].getTitle() instead of Movie[0].getTitle(). Parameters in a method are always accessed by it's name, not it's type.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.