A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Java in General
Author
Trouble with packages.
dimpsonu arora
Ranch Hand
Joined: Aug 13, 2003
Posts: 51
posted
Jul 01, 2004 00:56:00
0
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..............
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
I like...
posted
Jul 01, 2004 01:11:00
0
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
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Trouble with packages.
Similar Threads
package trouble
error while compiling
Package still not working
package problem
Compiling java files in different packages with single javac command
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter