0% found this document useful (0 votes)
0 views5 pages

TCS NQT Java Interview Q&A Shorts

The document provides a comprehensive list of the top 30 Java interview questions and their answers, covering key concepts such as features of Java, OOP principles, exception handling, and differences between various Java constructs. It includes explanations of terms like JVM, JRE, JDK, and details on data structures like ArrayList and LinkedList. The content is aimed at preparing candidates for Java-related interviews, particularly for TCS NQT 2025.

Uploaded by

imdbsmerchant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views5 pages

TCS NQT Java Interview Q&A Shorts

The document provides a comprehensive list of the top 30 Java interview questions and their answers, covering key concepts such as features of Java, OOP principles, exception handling, and differences between various Java constructs. It includes explanations of terms like JVM, JRE, JDK, and details on data structures like ArrayList and LinkedList. The content is aimed at preparing candidates for Java-related interviews, particularly for TCS NQT 2025.

Uploaded by

imdbsmerchant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

TCS NQT 2025: Top 30 Java Interview Questions with Answers

1. What are the features of Java?

Object-Oriented, Platform Independent (via JVM), Secure and Robust, Multithreaded, Distributed, High

Performance

2. What is JVM, JRE, and JDK?

JVM: Runs Java bytecode

JRE: JVM + Libraries

JDK: JRE + Development Tools

3. What is the difference between '==' and '.equals()' in Java?

'==' compares references, '.equals()' compares object content

4. What is a Constructor in Java?

A special method called when an object is created. Same name as class, no return type.

5. Explain OOPs concepts in Java.

Inheritance, Encapsulation, Abstraction, Polymorphism

6. What is the difference between Overloading and Overriding?

Overloading: Compile-time, different parameters

Overriding: Runtime, same method in subclass

7. What is the use of the 'final' keyword?

Final variable: constant

Final method: cannot be overridden

Final class: cannot be extended

8. What is the difference between ArrayList and LinkedList?


TCS NQT 2025: Top 30 Java Interview Questions with Answers

ArrayList: Faster access, slower insert/delete

LinkedList: Faster insert/delete, slower access

9. What is the difference between abstract class and interface?

Abstract class: Can have method bodies

Interface: Only abstract methods (Java 8+ allows default/static)

10. What is Exception Handling in Java?

Handle runtime errors using try, catch, finally, throw, throws

11. What is the difference between throw and throws?

throw: To throw an exception

throws: To declare exceptions

12. What is multithreading in Java?

Running multiple threads simultaneously using Thread or Runnable

13. What is the use of the 'this' keyword?

Refers to the current object in a method or constructor

14. What are access specifiers in Java?

private, default, protected, public - define visibility

15. What is garbage collection in Java?

Automatic memory management to delete unused objects

16. What are Wrapper Classes in Java?

Convert primitives to objects: int -> Integer, etc.


TCS NQT 2025: Top 30 Java Interview Questions with Answers

17. What is the difference between String, StringBuilder, and StringBuffer?

String: Immutable

StringBuilder: Mutable, not thread-safe

StringBuffer: Mutable, thread-safe

18. What is a static variable and method?

Static members belong to class, shared across objects

19. Can a class inherit multiple classes in Java?

No. Java supports single inheritance via classes, multiple via interfaces.

20. What is the difference between Stack and Heap memory in Java?

Stack: Method calls/local vars

Heap: Objects/instance vars

21. What is the difference between 'continue' and 'break' in Java?

'break' exits the loop completely.

'continue' skips the current iteration and moves to the next one.

22. What is method chaining in Java?

Calling multiple methods on the same object in a single line, e.g., obj.setA().setB().setC();

23. What are the types of polymorphism in Java?

Compile-time (method overloading) and Runtime (method overriding) polymorphism.

24. What is the use of the 'super' keyword?

Used to call the parent class constructor or method.


TCS NQT 2025: Top 30 Java Interview Questions with Answers

25. What is the difference between 'public static void main' and other methods?

'main' is the entry point for Java programs.

It must be public, static, and void.

26. What are Java Packages?

A namespace for organizing classes and interfaces. Example: java.util, java.io

27. What is the difference between 'instanceof' and 'getClass()'?

'instanceof' checks if an object is a subclass.

'getClass()' checks for the exact class.

28. What is a marker interface?

An interface with no methods or fields, used to mark classes for special treatment by the JVM (e.g.,

Serializable).

29. What is the difference between 'throwable', 'error', and 'exception'?

'Throwable' is the superclass.

'Error' is for serious issues.

'Exception' is for program-related exceptions.

30. What is a lambda expression?

A shorter way to represent anonymous functions using syntax: (parameters) -> expression.

You might also like