logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What is the difference between creating String as new() and literal ?


  • Correct Answer
  • When we create string with new() Operator, it?s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap String s = new String("Test"); does not put the object in String pool , we need to call Stringintern() method which is used to put them into String pool explicitly its only when you create String object as String literal eg String s = "Test" Java automatically put that into String pool 

  • Tags: Analyst, Database Administrator, IT Trainer, Project Manager

    Technology problems


    Search Results


    • 1. How can you make sure your dependencies are safe ?
    • Discuss
    • 2. If sub class data member is hiding super class data member then how to access super class data member inside sub class methods?
    • Discuss
    • 3. What is the fastest type of JDBC driver ?
    • Discuss
    • 4. What is a package?
    • Discuss
    • 5. Which of the following are valied?

    • Options
    • A. A class can extend any number of classes simulteneously
    • B. A class can implement only one interface at a time
    • C. A class can extend other class or can implement interface but not both simulteneously
    • D. None of the above
    • Discuss
    • 6. How do you handle error condition while writing stored procedure or accessing stored procedure from java ?
    • Discuss
    • 7. Which is a reserved word in the java programming language?

    • Options
    • A. Variable
    • B. Identifier
    • C. Keyword
    • D. Main
    • Discuss
    • 8. Which of the following best describes JavaScript?

    • Options
    • A. a scripting language precompiled in the browser.
    • B. an object-oriented scripting language
    • C. a low-level programming language.
    • D. a compiled scripting language.
    • Discuss
    • 9. Is it possible to nest functions in javascript?
    • Discuss
    • 10. Warning implicit declaration of function?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment