aspose file tools*
The moose likes Beginning Java and the fly likes what is ' . ' expected ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is Watch "what is New topic
Author

what is ' . ' expected ??

michael bradly
Ranch Hand

Joined: Oct 06, 2000
Posts: 112
I'm trying to compile a class that imports another and I keep getting a compiler error which reads:

(for some reason the carat isn't showing up under the semicolon, but that is where is should be)
I'm having a hard time finding what that error means. Any suggestions?
Regards, Michael
[ February 17, 2003: Message edited by: michael bradly ]
[ February 17, 2003: Message edited by: michael bradly ]
[ February 18, 2003: Message edited by: Marilyn de Queiroz ]
El Roy Cabildo
Greenhorn

Joined: Oct 19, 2002
Posts: 23
include what package thus SortedListArrayBased belongs e.g.
mypackage.util.SortedListArrayBased
or if the class (SortedListArrayBased) is on the same directroy or on the classpath create that directly.
SortedListArrayBased r = new SortedListArrayBased()
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Note that Sun's J2SDK 1.4 compiler won't allow the importing of a class in the default package. So, you cannot import SomeClass; You can only import somePackage.SomeClass


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
michael bradly
Ranch Hand

Joined: Oct 06, 2000
Posts: 112
Good to know. I'm using the 1.4 on Unix for the first time and had never seen that compiler error when using 1.3 on windows.. thx for the info..

Originally posted by Dirk Schreckmann:
Note that Sun's J2SDK 1.4 compiler won't allow the importing of a class in the default package. So, you cannot import SomeClass; You can only import somePackage.SomeClass
Zoltan Rajcsanyi
Greenhorn

Joined: Feb 18, 2003
Posts: 3
I experienced this probelm too. I solved the problem to remark the import function where I found class. The program was compiled. This problem appiled for the jdk 1.4.
For example:
import java.io.*;
//import myclass; (it is not a package!!!)
import mypackage.package.myclass
[ February 19, 2003: Message edited by: Zoltan Rajcsanyi ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: what is ' . ' expected ??