logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What is a Wrapper class?


  • Correct Answer
  • Wrapper classes wrap primitive values in a class and offers utility to access them through objects Some of the primitive wrapper data types are: Byte, short, int, long, float, double, char, Boolean Example: Create a class name VectorAdd to populate it with integer values using the add(int, object) method public class VectorAdd { public static void main(String argv[]) { Vector v = new Vector(); vadd(0,new Integer(10)); vadd(1,new Integer(20)); vadd(2,new Integer(30)); for(int i=0; i < vsize();i ++) { Integer iw =(Integer) vget(i); Systemoutprintln(iw); } } } 


  • Technology problems


    Search Results


    • 1. Exlpain STL.
    • Discuss
    • 2. .What are Stacks? Give an example where they are useful.
    • Discuss
    • 3. What are the advantages of using friend classes?
    • Discuss
    • 4. Explain one-definition rule (ODR).
    • Discuss
    • 5. What is mandatory for designing a new container?

    • Options
    • A. Classes
    • B. Iterators
    • C. Container
    • D. None of these
    • Discuss
    • 6. What do you mean by stack unwinding?
    • Discuss
    • 7. Difference between Stack and Queue
    • Discuss
    • 8. What is the scope resolution operator?
    • Discuss
    • 9. Differentiate between realloc() and free().
    • Discuss
    • 10. List the advantages of inheritance
    • Discuss


    Comments

    There are no comments.

Enter a new Comment