You are not logged in.
- Index
- » Quiz Questions
- » Class Test:
- 0
Pages:: 1
#1 2015-06-10 10:40:36
Class Test:
Question:
class Test
{
public static void main(String [] args) throws Exception
{
Vector data = new Vector();
data.add("apple");
data.add("mango");
data.add("papaya");
data.add("cherry");
data.add("banana");
data.add("apple");
System.out.println(getData(data));
}
public static Vector getData(Vector v)
{
return new Vector(new HashSet(v));
}
}
What would be the output?
Option A):
[banana, cherry, papaya, apple, apple, mango]
Option B):
Compile Error
Option C):
[banana, cherry, papaya, apple, mango]
Option D):
[apple, banana, cherry, mango, papaya]
Correct Answer is Option C):
[banana, cherry, papaya, apple, mango]
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-10 10:40:36
- Advertisement
- Ads By Google
Re: Class Test:
Pages:: 1