5
answers
0
watching
274
views
23 Aug 2018

2)What code would you add if you wanted to change it so that the user was able to continue entering a filename until the method initialize InventoryFromFile could successfully be exceuted? (e) Suppose I have the following class definition: 1 1/A TelevisionShow is a new type that consists of a String) for the actors |/ /a String for the name, and a string for the network public class Television Show private String[] actors; private String name; private String network; //this method will return whether or not the property //actors contains actor Name or not public static boolean hasActor (String actor Name) for (int i-0; i < actors.length; i++) { if (actors[i].equals (actorName)) { return true; return false; Unfortunately, when I try to compile this code, I get the following error: Television Show.java:11: non-static variable actors cannot be referenced from a static context for (int i=0; i < actors.length; i++) { Television Show.java:12: non-static variable actors cannot be referenced from a static context if (actors[i].equals(actorName)) { 2 errors What does this error mean and how can I fix it?

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Casey Durgan
Casey DurganLv2
25 Aug 2018
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in