7)

 Each element must be unique

 Duplicate elements must not replace old elements.

 Elements are not key/value pairs.

Accessing an element can be almost as fast as performing a similar operation on an array.

Which of these classes provide the specified features?

1.LinkedList

2.TreeMap

3.HashMap

4.HashSet

5.None of the above

Answer: 4

8)What is the result of attempting to compile and run the program?


class C1
{

static interface I

{
static class C2
{
}
}

public static void main(String a[])

{

C1.I.C2 ob1=new C1.I.C2();
System.out.println("object created");
}
}

1.prints object created
2.Compile time error
3.Runtime Excepion
4.None of the above

Answer: 1
Explanation:

A static interface or class can contain static members.Static members can be accessed without instantiating the particular class

9)What is the result of attempting to compile and run the program?

class C1

{

static class C2

{

static int i1;
}
public static void main(String a[])
{
System.out.println(C1.C2.i1);
}
}

1.prints 0
2.Compile time error
3.Runtime exception
4.None of the above

Answer: 1
Explanation:
static members can be accessed without instantiating the particular class
                                                                                                                                    more