For example,
class cons
{
int d;
cons(int a)
{
d=a;
}
void accept(String args[])throws IOException
{
What should I do next?
I want the accept() to accept value from the user, the then to initialize the instance variable with the help of the constructor.So I need to pass the accepted value to the constructor.But how? And I also want to create a main function to create a object and call the function accept().How to do so.I want to use only 1 constructor and not more.