File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes public class in package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "public class in package" Watch "public class in package" New topic

public class in package

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir suppose i would like to devlope a package as follow

package abc;
public class first{
now i will save this package with first name now if i want to store many public class in the abc package then how can i do that because one class contane only one public class , are you getting sir what i want to say hope yes. so how can i do that sir how?

with regad
Arun kumar maalik
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 236
you're not storing this package, but you're storing 'first' class in package 'abc'.
You can create as many classes as you want in this package.
Ivan Rebrov
Ranch Hand

Joined: Jul 09, 2006
Posts: 30
You should create multiple files. Each public class in it's own separate file.
[ August 12, 2006: Message edited by: Ivan Rebrov ]

SCJP 5.0 - 95%<br />Preparing for SCWCD
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Thanks sir i understood
I agree. Here's the link:
subject: public class in package
It's not a secret anymore!