In this code if I keep int i in the parameterized constructor, it throws an error. If anything other than int i is working fine.
Example: int j works fine. What is the reason for this error, please enlighten my knowledge.
//this program throws an error
class X
{
final int i;
X()
{
i = 0;
}
X(int i)//need to keep other than i
{
i = 20;
}
}
//this program works fine
class X
{
final int i;
X()
{
i = 0;
}
X(int j)
{
i = 20;
}
}