Results 1 to 4 of 4

Thread: problem in Importing packages

  1. #1
    Join Date
    Jul 2009
    Posts
    154

    problem in Importing packages

    HI
    When i started programming in java I started with an IDE. I used the IDE and learned how to make predefined classes and how to use it from outside its package. I am posting a simple example below
    Code:
    import myPackage.mClass;
    
    public class ClassInOtherPac {
    
        public static void main (String[] args) {
    
                  mlass myObj = new mClass();
        }
    }
    Now my question is how can I make the package importing when I an not using an IDE. because when i am in college we only use dos and old version of bluej. Please advice. i know this is a simple question but as I started form IDE, I do not know how to make it the other way.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: problem in Importing packages

    Hello
    I think you want to say that the IDE would not generate the import line for you. Is this your question.
    import myPackage.mClass;

    public class ClassInOtherPac {

    public static void main (String[] args) {

    mlass myObj = new mClass();
    }
    }
    Last edited by Praetor; 25-11-2009 at 01:28 PM.

  3. #3
    Join Date
    Jul 2009
    Posts
    154

    Re: problem in Importing packages

    Hi
    Thanks for replying
    That is the exact question. The problem is that I do not know exactly where to save the .class java file. I mean in which folder / package it will be located in so that I can call it. Is this is batch file I am referring to. please help. I think I do not have the basic knowledge of java, that is why I am going through just problems. And it was my big mistake to use the IDE at the staring of learning java. I am trying to improve it. Can you help please.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: problem in Importing packages

    Hi
    Well it is never late start studying java from the basics. No worries you can do it. And for your problem, you should have a source directory of something on which project you are working on. All the packages should be located there in a folder structure. I mean to say src/mypack and correspondingly all the class files will be located in this directory. This is the power of java. You can also use your own packages in other programs. But for now forget it, just study the basics.

Similar Threads

  1. Troubleshooting wmv importing problem in Final Cut Express
    By Benjhonson in forum Windows Software
    Replies: 5
    Last Post: 26-12-2010, 10:21 PM
  2. Problem importing a csv contact file into outlook 2010 beta
    By T@abitha in forum Windows Software
    Replies: 7
    Last Post: 16-10-2010, 09:07 AM
  3. Problem importing mail with Thunderbird
    By Corinne in forum Technology & Internet
    Replies: 4
    Last Post: 12-02-2010, 10:45 PM
  4. Problem in importing photos from Windows Vista
    By Chandraa in forum Portable Devices
    Replies: 4
    Last Post: 12-01-2010, 03:54 PM
  5. Problem importing Outlook Express files to Thunderbird
    By robin45 in forum Technology & Internet
    Replies: 3
    Last Post: 18-11-2009, 05:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,557,321.21832 seconds with 16 queries