Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

simply java questions - cd ...

Thread view: 
Thomas - 13 Jul 2007 22:06 GMT
Sorry I incorrectly presented the problem in my previous post : The
structure of the files is [an ought to be ] like that :
-Function.java
-RPN.java
-operand.java
-Symbol.java
--my_package:
   -Stack.java
   .................
========================================================

The Stack use the Sybmol class. I got unrecognized symbol Symbol in Stack.
What should i do ?
Roedy Green - 13 Jul 2007 22:09 GMT
>Sorry I incorrectly presented the problem in my previous post : The
>structure of the files is [an ought to be ] like that :
[quoted text clipped - 4 lines]
>--my_package:
>    -Stack.java

When you have more than one class, you put classes in a package, and
put the *.java files in the structure to reflect packages.
see http://mindprod.com/jgloss/package.html

Further all class names and hence *.java file names must begin with a
capital letter.

See http://mindprod.com/jgloss/naming.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Lew - 13 Jul 2007 22:25 GMT
"Thomas" wrote,
>> -operand.java

> Further all class names and hence *.java file names must begin with a
> capital letter.

s/must/should/

> See http://mindprod.com/jgloss/naming.html

Signature

Lew

Roedy Green - 15 Jul 2007 01:06 GMT
>s/must/should/

I disagree on that.  It is advice similar to washing your hands after
using the toilet before preparing food.

You can also name all your methods m1 m2 etc, but there is no reason
to remind idiots of the option.

This is effectively a classroom, and good practice is mandatory.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Arne Vajhøj - 15 Jul 2007 01:18 GMT
>> s/must/should/
>
[quoted text clipped - 5 lines]
>
> This is effectively a classroom, and good practice is mandatory.

Exactly.

It is important to understand the difference between
what is required by the language and what is good
practice.

And therefore it is very bad to confuse the readers
by using must and should as if it means the same.

Arne
Knute Johnson - 15 Jul 2007 03:36 GMT
>>> s/must/should/
>>
[quoted text clipped - 16 lines]
>
> Arne

Capital first letters of class names in Java is just a convention.  It
is neither best nor worst practice.

Signature

Knute Johnson
email s/nospam/knute/

Arne Vajhøj - 15 Jul 2007 03:53 GMT
> Capital first letters of class names in Java is just a convention.  It
> is neither best nor worst practice.

I think there are many that consider following SUN's coding convention
for best practice.

Arne
Lew - 13 Jul 2007 22:21 GMT
> Sorry I incorrectly presented the problem in my previous post :

Since this is the first post in this thread, there is no "previous" post.

> The structure of the files is [an ought to be ] like that :
> -Function.java

Are you saying that this is in the default package?

> -RPN.java
> -operand.java

By the Sun-recommended convention, class names should start with an upper-case
letter.  (It's in the JLS.
<http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.8>
<http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.8.2>
)

> -Symbol.java
> --my_package:
[quoted text clipped - 4 lines]
> The Stack use the Sybmol class. I got unrecognized symbol Symbol in Stack.
> What should i [sic] do ?

Import the Symbol class into your Stack code.

All classes must be referred to by their fully-qualified names, implicitly or
explicitly.  If you don't spell out the full name, you have to let the
compiler fill in the missing package specification(s) via the "import" directive.

You cannot import classes from the default package.

Signature

Lew

Knute Johnson - 14 Jul 2007 02:16 GMT
>> Sorry I incorrectly presented the problem in my previous post :
>
[quoted text clipped - 4 lines]
>
> Are you saying that this is in the default package?

If it is it is going to cause him unending grief.  He would be better
off with no packages.

Signature

Knute Johnson
email s/nospam/knute/

Lew - 14 Jul 2007 15:10 GMT
>>> Sorry I incorrectly presented the problem in my previous post :
>>
[quoted text clipped - 7 lines]
> If it is it is going to cause him unending grief.  He would be better
> off with no packages.

I disagree.  (Not just because the default package is a package and therefore
"no packages" is not actually possible.)  Using the default package for any
code involving more that one class or for any purpose other than a
quick-and-dirty test is a Bad Thing.  If one is using the default package any
other way, they're better off not using Java at all.

The Sun Java tutorial discusses the use of packages:
<http://java.sun.com/docs/books/tutorial/java/package/index.html>

Signature

Lew

Knute Johnson - 14 Jul 2007 17:36 GMT
>>>> Sorry I incorrectly presented the problem in my previous post :
>>>
[quoted text clipped - 17 lines]
> The Sun Java tutorial discusses the use of packages:
> <http://java.sun.com/docs/books/tutorial/java/package/index.html>

Obviously I was not clear.  What I meant was attempting to mix code from
the default package and another package (which is what it looked like he
was trying to do).

Signature

Knute Johnson
email s/nospam/knute/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.