This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Query" Watch "Query" New topic


Kartik Mahadevan
Ranch Hand

Joined: Feb 16, 2005
Posts: 47
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 ???

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

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 , just as you would do for a class.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Query
Similar Threads
Access to constants
interface is nothing but a pure abstract class. why interface does not has constructor
JDBC Call-Level Interface question.
Interface extending another Interface
What to put into a SAR file?