logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What is Thread ?


  • Correct Answer
  • A thread is a lightweight subprocess, a smallest unit of processing It is a separate path of execution It shares the memory area of process As shown in the above figure, thread is executed inside the process There is context-switching between the threads There can be multiple processes inside the OS and one process can have multiple threads 


  • Technology problems


    Search Results


    • 1. What is the difference between creating a thread by extending Thread class and by implementing Runnable interface? Which one should prefer?
    • Discuss
    • 2. What are the the different ways for creating a thread?
    • Discuss
    • 3. How does a try statement determine which catch clause should be used to handle an exception?
    • Discuss
    • 4. What is static initializer block? What is its use?
    • Discuss
    • 5. What is the impact of declaring a method as final?
    • Discuss
    • 6. What do you understand by private, protected and public?
    • Discuss
    • 7. If a method is declared as protected, where may the method be accessed?
    • Discuss
    • 8. What is the difference between method overriding and overloading?
    • Discuss
    • 9. What is classloader?
    • Discuss
    • 10. What will be the output of the following code snippet? Object s1 = new String("Hello"); Object s2 = new String("Hello"); if(s1 == s2) { System.out.println("s1 and s2 are =="); }else if (s1.equals(s2)) { System.out.println("s1 and s2 are equals()"); }
    • Discuss


    Comments

    There are no comments.

Enter a new Comment