posted 23 years ago
Read the following piece of code carefully.
public class A
{
A()
{
}
}
1) The class A can be referenced outside the package in which it is defined.
2) The class A cannot be instantiated outside the package in which it is defined.
3) The class A cannot be extended outside the package in which it is defined.
4) The class A can be referenced, instantiated or extended anywhere.
5) The above code will cause a compiler error. The constructors of public class have to be coderanch.
Answer:1,2,3.
can u pl explain what does the option 1) mean?(if possible then with some code)