cannot comile user defined classes

Hello i have a problem on compiling user defined classes .

example

file x.java

public class x{

...........................

}

file y.java

import x;

public class y{

}

I first compile x.java and everything is OK .

Then i compile y.java and the compiler gives the folowing

y.java:2: '.' expected

import y

I have tried to put the classes on a package and added the folowing line yo each file

import /home/bill/test

Then i puted the java files on that dir

and compiled with

javac -classpath /home/bill/test y.java

AGAIN THE SAME

y.java:2: '.' expected

import y

WHAT I DO WRONG PLEASE HELP!!!!!!!!!!!!

[741 byte] By [vasdiaa] at [2007-10-2 3:56:32]
# 1

1. Since J2SDK 1.4, you can not import classes that are in the default (or unnamed) package. You are getting the error because the compiler expects something after y like y.*;

2. You do not need to import classes that are in the same package, and all classes in the default package are in the same package.

In your case, your classes are in the default package so remove the import statement.

atmguya at 2007-7-15 23:17:56 > top of Java-index,Developer Tools,Java Compiler...