Interview Q&A / Java

INTERVIEW Q&A · 72 QUESTIONS

Java interview questions

Collections, the JVM, strings, exceptions and threads, the backbone of most campus placement rounds.

  1. Should you extend Thread or implement Runnable in Java?

    Implement Runnable in most cases. It separates the task from the thread, leaves your class free to extend something else, and works with thread pools. Extending Thread only makes sense if you are changing the thread behaviour itself.

    BeginnerQuick answer1 min read