Results 1 to 3 of 3
Thread: A difficult question
- 01-31-2010, 09:30 AM #1
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
A difficult question
Can anyone help me with this? THANK YOU VERY MUCH!
If the java file name is ABC.java.
Why are some classes defined before the public class ABC?
e.g.
class sparse_binary_vector
{
Vector id = new Vector();
}
class sparse_vector
{
Vector id = new Vector();
Vector val = new Vector();
}
public class ABC
{
...
}
- 01-31-2010, 10:34 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
You can define more than one class in a single source file but only one of them can be public, the other classes have to have package scope. More than one class per source file suggests a tight coupling of the non-public classes with the single public class. It can be abused though.
kind regards,
Jos
- 01-31-2010, 09:45 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
Similar Threads
-
Question mark colon operator question
By orchid in forum Advanced JavaReplies: 9Last Post: 12-19-2010, 08:49 AM -
Difficult compilation
By pochis40 in forum Java AppletsReplies: 10Last Post: 12-21-2009, 12:35 PM -
ur help on my question
By jameela in forum New To JavaReplies: 4Last Post: 10-13-2008, 12:38 PM -
Java's web world is really difficult..
By jurka in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 09-02-2008, 05:33 PM -
question on jsp
By munigantipraveen in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 06-30-2008, 02:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks