I wrote a Java class with two constructors and few methods:
public class A
{
public A() // default constructor
{
...
}
public A(in a) // constructor with one parameter
{
...
}
public void processSelectedData()
// should be called only when object of class A is created
// using constructor with one parameter
{
...
}
public void processEverything()
// should be called only when object of class A is
// created using default constructor
{
...
}
}
The code comments will brief you about what I am looking for. How can I impose these rules. I don't want the user to call the every method with an object.
Thanks for your help.