Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Question on instructions for Java

  1. Mar 7, 2014 #1
    Can someone tell me what they think this is referring to?

    On the create event for a form add 3 animal instances to a list.

    A form just meaning a GUI? and what does it mean on the create event? Clicking something to add the animals perhaps?
  2. jcsd
  3. Mar 7, 2014 #2
    The information you're providing is pretty sketchy but ...
    Apparently there is a procedure for handling a "Create" event - perhaps a "Create Form" event. In that procedures a form object is created. Apparently there is an animal class and a list that can hold animal object or pointers to animal objects. It isn't specified whether the Form includes this list or if the lists exists elsewhere. If the list doesn't already exist, them perhaps you're suppose to add it to either the forum class or to the class of the object that is handling the event.
  4. Mar 7, 2014 #3


    Staff: Mentor

    camel-man, there's a lot here that is not clear, such as exactly what a "form" is (i.e., exactly which Java class).

    "on the create event for a form" - you need to write a handler for the Create event. When that event is fired, your event handler begins executing

    "add 3 animal instances" - you are either given a definition for the animal class, or you have to write it yourself. Either way, in the body of your event handler for the create event, add three instances of the animal class to whatever list you need to be working with.

    Hope that helps, but your problem description is pretty vague.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Question on instructions for Java
  1. Java Question (Replies: 2)

  2. Java question (Replies: 5)

  3. Java Question (Replies: 2)

  4. Java Question (Replies: 3)

  5. Question about Java (Replies: 4)