Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trouble with packages.

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi All,
I am making two directories pack2 and pack3 under c:/java/pack1. The directory structure is:
c:/java/pack1/pack2/abc.java
c:/java/pack1/pack3/hello.java

1.c:/java/pack1/pack2/abc.java
***********abc.java**********

package pack1.pack2;
public class abc
{
public void abc()
{
System.out.println("Hello I am ABC.");
}
}

2.c:/java/pack1/pack3/hello.java
*********Hello.java*********

package pack1.pack3;
import pack1.pack2.*;
public class hello
{
public static void main(String args[])
{
abc obj=new abc();
obj.abc();
System.out.println("Hello World");
}
}

When I try to compile hello.java it gives compilation error at
import pack1.pack2.*; does not exist.
Plz help..............
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post the same question in multiple forums. It creates duplicate conversations and wastes the time of the people trying to help you.

I'm going to ask for this thread to be closed. Anyone who wants to help should see the copy here.

Dave
 
    Bookmark Topic Watch Topic
  • New Topic