You are not logged in.
Pages:: 1
#1 2015-06-10 09:40:06
Java Constructor:
Directions:
Java Constructor
class Nest
{
Nest()
{
System.out.print("Nest");
}
Nest (long l)
{
this();
System.out.print(l);
}
Nest(int i)
{
this(i);
System.out.print(i*2);
}
}
Public static void main(String[] args)
{
int i = 4;
new Nest(i);
}
Question:
What would be the output?
Option A):
Nest44
Option B):
Nest84
Option C):
Nest48
Option D):
Compile Error
Correct Answer is Option D):
Compile Error
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-10 09:40:06
- Advertisement
- Ads By Google
Re: Java Constructor:
\n
Pages:: 1