aspose file tools*
The moose likes Beginning Java and the fly likes import statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "import statement" Watch "import statement" New topic
Author

import statement

shanker sothi
Greenhorn

Joined: Oct 19, 2003
Posts: 4
Say I have a package higherachy like this
net.xpack.ypack.zpack.abc
here abc is a "abc.class" file.
I want to use it in my current class.
so I import it as
import net.xpack.ypack.*;
when I access it with
zpack.abc.input();//here input is a public method under abc
There is an error?
please help me to solve this.
Arulkumar Gopalan
Ranch Hand

Joined: Oct 13, 2003
Posts: 104
I think you have to import the package where it is located...
import net.xpack.ypack.zpack.*;


Anbudan & Mahalo,<br />Arul<br /> <br />-Not a sun certified Java professional :-)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Although it looks as though zpack is "inside" ypack, as far as Java is concerned they're two separate unrelated packages. importing the classes in ypack doesn't tell the compiler to look in zpack, too.


[Jess in Action][AskingGoodQuestions]
shanker sothi
Greenhorn

Joined: Oct 19, 2003
Posts: 4
Thanks
Arul & Hill.
Shanker
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import statement
 
Similar Threads
String Object
Variable Declartion
Hashcode program error
related to servlet
csv file