
Signature
Debian/apt Repo: http://locataire-serveur.info/sections/liens/debian-repository
Fedora/yum Repo: http://locataire-serveur.info/sections/liens/fedora-core-yum
> Hi,
>
[quoted text clipped - 17 lines]
> "importing". How should I?
> What keyword should I use to find the solution?
You need more than one piece of the puzzle.
My bet is that currently you don't specify a "package" in either of
your java files. That means they're both in the "default package,"
and I don't think you'll be able to use import successfully.
Package statements go on the very first line of a file. So you could
add 'package src;' to the top of Pair.java and 'package tests;' to the
top of Tests.java. Then you would add 'import src.Pair;' to Tests.java
between the package statement and the class definition.
Strictly speaking, packages should follow a naming convention that is
unique to you. The preferred convention is to use a reversed domain
name. So, since my domain is bounceswoosh.org, a proper package name
might be 'org.bounceswoosh.grokulator' (assuming I have a grokulator
application) or 'org.bounceswoosh.lib' (for common stuff).
Hope that's slightly clearer than mud.

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
R12y - 23 Mar 2006 15:32 GMT
> So, since my domain is bounceswoosh.org, a proper package name
> might be 'org.bounceswoosh.grokulator' (assuming I have a grokulator
> application) or 'org.bounceswoosh.lib' (for common stuff).
Could this be the unix domainname of the machine (localdomain by default)?
I also heard about CLASSPATH, but dont like it since it could not be
useable on another machine.

Signature
Debian/apt Repo: http://locataire-serveur.info/sections/liens/debian-repository
Fedora/yum Repo: http://locataire-serveur.info/sections/liens/fedora-core-yum
Monique Y. Mudama - 23 Mar 2006 16:07 GMT
>> So, since my domain is bounceswoosh.org, a proper package name
>> might be 'org.bounceswoosh.grokulator' (assuming I have a
[quoted text clipped - 4 lines]
> default)? I also heard about CLASSPATH, but dont like it since it
> could not be useable on another machine.
Well, the idea is that your package structure is unique. I think
that's why the reversed net domain is used; the theory (however
optimistic) is that a domain will remain attached to you for as long
as the package remains relevant.
Maybe the top entry here will help a little:
http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
But this is really only important for big apps that might see the
light of day. There's no harm in creating an impromptu package
structure when you're just learning the language and running test
apps.

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html