Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: calling to another class from another class

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default calling to another class from another class

    In my program I am trying to write I want to call to another class which has variables stored in it that I want to call and print out in an entire different class under one package in eclipse. In this program I am trying to design a working airport in which it tracks airplanes coming in to the airspace then land and being taxied off. Also planes take off from this airport. So i created an airport class in which all the loops and functions take place then a Runway object class to store the different variables each plane created needed such as flight number, amount if fuel(if incoming), and incoming altitude (also if incoming). If any body could show me the syntax to connect these two classes. And if you know how priority queues work that would be helpful. If you need to see the code let me know

    thanks


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,697
    Thanks
    25
    Thanked 334 Times in 310 Posts

    Default Re: calling to another class from another class

    Ok, there is a bit of information there which is not very relevant to your specific question.

    Give us a brief overview of the classes you made, and how they interact. For example, if you were creating a program that was a car mechanic business or something, you would have something like this:
    1. A Car class which represents a car that is being serviced
    2. A Garage class which can contain at most one Car at any time
    3. A Building class which contains a list of Garages

    In this example, Building would have an array of Garages, and each Garage would have a Car variable.

    What classes do you have for your airport, and how do they interact with each other?

    As for your question about the Priority Queue, are you allowed to use the Priority Queue class (PriorityQueue (Java Platform SE 6))?
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  3. The Following User Says Thank You to aussiemcgr For This Useful Post:

    Diesel298 (November 13th, 2012)

  4. #3
    Junior Member
    Join Date
    Nov 2012
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: calling to another class from another class

    I actually got it it was a simple error of me putting a queue in the main argument rather in another class. Also about the priority queues our professor said he would go over it tomorrow. Thanks for the help though I really appreciate it.

Similar Threads

  1. calling a method in class
    By MrBean in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 31st, 2012, 01:31 AM
  2. Calling / Updating class?
    By JuLiAnc in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 14th, 2012, 07:56 AM
  3. about calling sub class
    By pokuri in forum Object Oriented Programming
    Replies: 3
    Last Post: January 11th, 2011, 03:30 PM
  4. Help Calling Method From Another Class
    By CheekySpoon in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 15th, 2010, 10:24 AM
  5. [SOLVED] How to call string in another class in java?
    By tazjaime in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 23rd, 2009, 10:31 AM