TCS Technical Interview Questions
TCS Technical Interview Questions
programs are organized as a set of functions. It offers low-level memory access and is primarily
used for system programming, embedded systems, and performance-critical applications. Java, on
the other hand, is an object-oriented programming language. It uses a bottom-up approach and
organizes code into classes and objects. Java is platform-independent thanks to the Java Virtual
Machine (JVM), supports garbage collection, and is widely used in enterprise-level applications and
Android development.
- Encapsulation: Wrapping of data (variables) and code (methods) into a single unit called a class. It
helps in data hiding and provides access control through private, public, and protected access
modifiers.
- Abstraction: Hides implementation details from the user and shows only functionality. Achieved
- Inheritance: Mechanism by which one class (child) can acquire properties and behaviors (methods)
- Polymorphism: The ability of an object to take many forms. Achieved through method overloading
- The .equals() method is used to compare the contents of two objects. For example, in String
A constructor is a special method that is automatically called when an object is created. It has the
same name as the class and does not have a return type. Constructors are used to initialize objects.
There are two types: Default constructor (no parameters) and Parameterized constructor (accepts
- Method Overloading: Same method name with different parameters within the same class. It
(Continued in PDF...)