what would i need to do if only one instance of a class should be produced?
anyone can use only one object..(Question asked in HF
java book)
soln:
This is sample class code snippet.Please say whether it is correct for the above question...
public class firstclass
{
static count=0;
firstclass()
{
if (count<=0){
system.out.println("object created");
count++;
}
}
}