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


    Hi,

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

    Thanks

  2. #2
    Kyle Gabhart Guest

    Re: beginner Java package Question


    "vt" <vmt007@hotmail.com> wrote:
    >
    >Hi,
    >
    >Does using the package statement add a class to an existing package when
    >compiled using "Javac"?
    >
    >Thanks


    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'.
    -com
    |-something
    |-file
    |-*.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!

    Cordially,

    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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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