This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes bad class file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "bad class file" Watch "bad class file" New topic
Author

bad class file

Arul Jose
Ranch Hand

Joined: Jan 14, 2005
Posts: 131
I wrote the following classes

packclass.java


accesspack.java


When I compiled, I get the following error message



I could not get what the error is ...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

[aruljose@aruljose javatry]$ ls newpack/
packclass.class

Can you please do a "ls ." ?
packclass.java should be in newpack/
[ February 14, 2006: Message edited by: Satou kurinosuke ]

[My Blog]
All roads lead to JavaRanch
Arul Jose
Ranch Hand

Joined: Jan 14, 2005
Posts: 131
yes it did work. thanks.

but do we need the source file?

the class file is not enough?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

You don't need the source file, but you have to remove it from the current directory. The compiler will try to compile packclass.java if it finds it in the same directory as accesspack.java
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Arul,

I'd just like to make a comment on style.

Even though your class names don't break any Java compiler rules, there is a generally accepted standard that suggests that class names begin with a capital letter. If the class name is a combination of nouns (a noun phrase for the lack of a better term) each beginning letter of the name should be a capital. So in your case:

use Accesspack or AccessPack instead of accesspack.

Regards,
JD
 
 
subject: bad class file
 
Similar Threads
a simple doubt - but ......
Compiler works, but it doesnt run
A Package Question
a simple question, but......
classpath Ques