File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is ' . ' expected ??

 
michael bradly
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
michael bradly
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic