beginner Java package Question

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: beginner Java package Question

  1. #1
    vt Guest

    beginner Java package Question


    Does using the package statement add a class to an existing package when
    compiled using "Javac"?


  2. #2
    Kyle Gabhart Guest

    Re: beginner Java package Question

    "vt" <> wrote:
    >Does using the package statement add a class to an existing package when
    >compiled using "Javac"?

    Yes, assuming that the directory structure for your source code corresponds
    to directly to the package statement (i.e. package com.something.file.*;
    will include every class file with that package statement located in the
    'file' directory under 'something', which is under 'com'.
    |-*.java files with appropriate package statement

    You can now modify any of the '.java' files in the 'file' directory or add
    new '.java' files, recompile the package and the new source code will be
    included in the already existing package.

    Happy Coding!


    Kyle Gabhart
    Devx Java Pro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center