Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sir_Spritely

[java] Package/Class Hierarchies confusion

This topic is 5701 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have set up a project titled Alarm and in the project I have a file called Initial_Setup.java, declared like: - public class Initial_Setup { public static void main ( String [] args )throws IOException I have another file titled tester.java, setup like, import java.io.*; public class tester extends Initial_Setup { public static void main ( String [] args ) throws IOException What I am trying to do is set up the program so that when it executes it will first run through Initial_Setup and then move onto tester.java. However tester.java needs to access some variables which are filled with a value from the keyboard. How can I do this? Also how can I setup the program so that when the end of Initial_Setup is reached it moves onto tester.java? If you need code to look at then I will post it but I''m pretty sure it is not needed. I''m fairly sure it is a typical thing I am trying to accomplish. Thanks, Pk.

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Sir_Spritely
I have set up a project titled Alarm and in the project I have a file called Initial_Setup.java, declared like: -

public class Initial_Setup
{
public static void main ( String [] args )throws IOException

I have another file titled tester.java, setup like,

import java.io.*;
public class tester extends Initial_Setup
{
public static void main ( String [] args ) throws IOException

What I am trying to do is set up the program so that when it executes it will first run through Initial_Setup and then move onto tester.java.

However tester.java needs to access some variables which are filled with a value from the keyboard.

How can I do this?

Also how can I setup the program so that when the end of Initial_Setup is reached it moves onto tester.java?

If you need code to look at then I will post it but I''m pretty sure it is not needed. I''m fairly sure it is a typical thing I am trying to accomplish.

Thanks,

Pk.


I think you''re not getting the point of the "extends" keyword, it just means that you''re deriving your tester class from Initial_Setup.



[Cyberdrek | the last true sorcerer | Spirit Mage - mutedfaith.com]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!