logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How are this() and super() used with constructors?


  • Correct Answer
  • Constructors use this to refer to another constructor in the same class with a different parameter list Constructors use super to invoke the superclass's constructor If a constructor uses super, it must use it in the first line; otherwise, the compiler will complain 


  • Technology problems


    Search Results


    • 1. Just by seeing the signature of the bean how can you specity whether it is a Statefull of Stateless Session Bean?
    • Discuss
    • 2. Difference between Java Beans & Servlets?
    • Discuss
    • 3. try { int x = Integer.parseInt("two"); } Which could be used to create an appropriate catch block?

    • Options
    • A. ClassCastException
    • B. IllegalStateException
    • C. NumberFormatException
    • D. None
    • Discuss
    • 4. class Hell { public static void main(String[] args) { Integer i = 42; String s = (i<40)?"life":(i>50)?"base":"ball"; System.out.println(s); } }

    • Options
    • A. null
    • B. ball
    • C. base
    • D. None
    • Discuss
    • 5. Which is true?

    • Options
    • A. "X extends Y" is correct if and only if X is a class and Y is an interface
    • B. "X extends Y" is correct if and only if X is a class and Y is an interface
    • C. "X extends Y" is correct if X and Y are either both classes or both interfaces
    • D. "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
    • Discuss
    • 6. How do you decide when to use HashMap and when to use TreeMap ?
    • Discuss
    • 7. What is the Dictionary class?
    • Discuss
    • 8. What is the common usage of serialization? What exceptions occur during serialization?
    • Discuss
    • 9. What is the purpose of garbage collection in Java, and when is it used ?
    • Discuss
    • 10. When is the finalize() called ? What is the purpose of finalization ?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment