Results 1 to 2 of 2
  1. #1
    carrot_spy is offline Member
    Join Date
    Oct 2012
    Washington State
    Rep Power

    Default Calling on other class methods?

    Hey I'm new to java, and haven't quite figured out some of the class workings...

    I'm being asked to create a class called PairOfDice that will create two objects by rolling a pair of dice. Then I need a driver class called BoxCars to operate PairOfDice 1000 times. I don't really know how to call upon the PairOfDice class within the BoxCars class in order to get the two objects. Any help would be greatly appreciated!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default Re: Calling on other class methods?

    BoxCars will hold a PairOfDice variable which will reference a PairOfDice object. You will call the method on the PairOfDice variable.

Similar Threads

  1. A class calling methods from external class
    By Aaron5466 in forum New To Java
    Replies: 4
    Last Post: 04-16-2012, 11:36 AM
  2. Replies: 16
    Last Post: 11-25-2011, 02:18 PM
  3. Calling base class methods
    By new2java2009 in forum New To Java
    Replies: 1
    Last Post: 11-15-2011, 11:47 PM
  4. Calling methods into another class? Help please!
    By javanator in forum New To Java
    Replies: 1
    Last Post: 03-20-2010, 07:19 PM
  5. 'Class' Object and calling Static Methods?
    By mikeiz404 in forum New To Java
    Replies: 2
    Last Post: 01-24-2009, 06:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts