• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query

 
Kartik Mahadevan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone please tell me what is this ClASSPATH and what is it's use?
Secondly can constructors be private?
Suppose I have to define only one interface in a FILE and no other code (no other class except interface )how should I save this file ?As .java ???


Thanks
Regards
M.Kartik
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can read about CLASSPATH here.

Yes, constructors can be private. Only code within the class can use such a constructor, of course, but sometimes this is handy -- for example, if you need to create a Singleton class.

If the interface is named Foo, then name the file Foo.java , just as you would do for a class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic