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: Packages in Eclipse:

  1. #1
    Member
    Join Date
    Apr 2014
    Posts
    219
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default Packages in Eclipse:

    My question right now is about packages. I am using eclipse if that matters and lets say I make 5 classes. Are all classes in the same package if I declare (package myPak)? Then later in a different project say import myPak*.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Packages:

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    Source code in Eclipse is either in the default package (unspecified) or in the package specified by the package statement. There is a corresponding file structure that must be maintained or Eclipse will give error messages with offers to correct any mistakes in the structure.

    You last sentence is a bit more mysterious, so perhaps you can come back to that when it's clearer.

Similar Threads

  1. Java Packages creat and run in Eclipse
    By nilesh.surwade@gmail.com in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 29th, 2014, 03:23 AM
  2. Java Packages
    By jothi in forum Java Theory & Questions
    Replies: 4
    Last Post: August 21st, 2013, 09:04 PM
  3. Trying to Figure out Packages
    By tyeeeee1 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 18th, 2013, 01:33 PM
  4. packages
    By Spidey1980 in forum Java Theory & Questions
    Replies: 2
    Last Post: October 6th, 2011, 06:45 PM
  5. Packages and Servlets
    By god1gracious in forum Java Servlet
    Replies: 3
    Last Post: October 1st, 2011, 10:05 AM