TCS NQT Java Interview Q&A Shorts
TCS NQT Java Interview Q&A Shorts
Object-Oriented, Platform Independent (via JVM), Secure and Robust, Multithreaded, Distributed, High
Performance
A special method called when an object is created. Same name as class, no return type.
String: Immutable
No. Java supports single inheritance via classes, multiple via interfaces.
20. What is the difference between Stack and Heap memory in Java?
'continue' skips the current iteration and moves to the next one.
Calling multiple methods on the same object in a single line, e.g., obj.setA().setB().setC();
25. What is the difference between 'public static void main' and other methods?
An interface with no methods or fields, used to mark classes for special treatment by the JVM (e.g.,
Serializable).
A shorter way to represent anonymous functions using syntax: (parameters) -> expression.