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 5 of 5

Thread: importing packages..

  1. #1
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default importing packages..

    i've been using a full blown IDE ever since i started programming in java...
    i learned how to make predefined classes, and how to use it from out side its package...


    somethinglike this.
     
    import myPackage.MyClass;
     
    public class ClassInOtherPackage {
     
        public static void main (String[] args) {
     
                  MyClass myObj = new MyClass();
        }
    }


    now my question is.... how can i make this , package importing ,, when im using an ordinary IDE,
    specially when im in shcool,.. coz were only using DOS, old versions of Bluej and JC,,


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: importing packages..

    You mean the IDE wont generate the import line for you?

    // Json

  3. #3
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: importing packages..

    yup,, coz i dont know where should i save the java file(the class) into a folder that will be the package that i will
    call if im not using any full blown IDEs


    is that a "batch file" im referring to?
    Last edited by chronoz13; November 23rd, 2009 at 07:38 AM.

  4. #4
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: importing packages..

    Well you should have a src folder of some sort I guess and in that you want to have your packages in a folder structure.

    src/myPackage

    and in that myPackage folder you want to have MyClass.java

    Simples

    // Json

  5. The Following User Says Thank You to Json For This Useful Post:

    chronoz13 (November 23rd, 2009)

  6. #5
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: importing packages..

    ahh... im gonna try to manualy arrange it that way .... tnx for that sir!

Similar Threads

  1. Importing excel data
    By supriya ramjee in forum File I/O & Other I/O Streams
    Replies: 11
    Last Post: October 20th, 2012, 09:39 AM