-
Java packages
Hi, I am new to java and was wondering if anyone could explain to me how java packages are mapped to the file system?
-
Hi,
the package to file system mapping is reasonably straightforward.
Assume that the current directory is C:\Javadev
take the package name, and for each . replace with a \ this gives you the directory structure.
So if you compile the following class
package com.JGRobinson;
class Test
{
}
When you compile it, it will create the Test.class file in
C:\Javadev\com\JGRobinson
note that for linux/unix case is important.
a package uk.co.google would be compiled to a .class file in
C:\Javadev\uk\co\google
Hope this helps
Graham
-
That's great. Thanks a lot!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks