logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What?s the difference between Enumeration and Iterator interfaces ?


  • Correct Answer
  • Enumeration is twice as fast as compared to an Iterator and uses very less memory However, the Iterator is much safer compared to Enumeration, because other threads are not able to modify the collection object that is currently traversed by the iterator Also, Iteratorsallow the caller to remove elements from the underlying collection, something which is not possible with Enumerations 


  • Technology problems


    Search Results


    • 1. What do you know about the big-O notation and can you give some examples with respect to different data structures ?
    • Discuss
    • 2. What are the basic interfaces of Java Collections Framework ?
    • Discuss
    • 3. What is the difference between processes and threads ?
    • Discuss
    • 4. Explain different ways of creating a thread. Which one would you prefer and why ?
    • Discuss
    • 5. What are pass by reference and pass by value ?
    • Discuss
    • 6. What is the output of this program ? class main_arguments { public static void main(String [ ] args) { String [][] argument = new String[2][2]; int x; argument[0] = args; x = argument[0].length; for (int y = 0; y < x; y++) System.out.print(" " + argument[0][y]); } }

    • Options
    • A. 1 1
    • B. 1 0
    • C. 1 0 3
    • D. 1 2 3
    • Discuss
    • 7. What is autoboxing and unboxing ?
    • Discuss
    • 8. Can you access non static variable in static context ?
    • Discuss
    • 9. What is the difference between an Interface and an Abstract class ?
    • Discuss
    • 10. Which of the following statements are equal for a variable declared in the interface ? 1. int X=10 2. public int X=10 3. public static final int X=10

    • Options
    • A. Only 1 and 2 are equal
    • B. Only 2 and 3 are equal
    • C. All are unequal
    • D. All are equal
    • Discuss


    Comments

    There are no comments.

Enter a new Comment