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

Thread: import question

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default import question

    how do I import a class from the default package of another project?
    a good programmer can write a Java program in any language


  2. #2
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    490
    Thanks
    8
    Thanked 46 Times in 44 Posts

    Default Re: import question

    A class in a package cannot use a class in the default package. A class in the default package can use a class in the same default package: in the same folder. That applies both at compile time (.java source files in the same folder) and at runtime (.class class files in the same folder).

    Since Java 1.4, it is recommended to not place classes in the default package. Get up to date!

    db

Similar Threads

  1. Something wrong with the import things
    By mingming8888 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 25th, 2010, 07:30 AM
  2. from where i should import
    By javaking in forum Java SE APIs
    Replies: 0
    Last Post: April 12th, 2010, 07:51 AM
  3. [SOLVED] Do i need to import anything here?
    By straw in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 6th, 2010, 05:42 PM
  4. Problem in import com. in eclipse
    By java_cs in forum What's Wrong With My Code?
    Replies: 6
    Last Post: September 11th, 2009, 07:26 AM
  5. How to import an .tiff image in JSP?
    By jazz2k8 in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: May 12th, 2008, 05:55 AM