Add office photos
TCS logo
Engaged Employer

TCS

Verified
3.7
based on 90k Reviews
Video summary
Filter interviews by
Java Developer
Fresher
Experienced
Clear (2)

TCS Java Developer Interview Questions and Answers for Freshers

Updated 28 Jan 2025

Q1. What is compile time polymorphism and runtime polymorphism?

Ans.

Compile time polymorphism is achieved through method overloading, while runtime polymorphism is achieved through method overriding.

  • Compile time polymorphism is also known as static polymorphism.

  • It is achieved by having multiple methods in the same class with the same name but different parameters.

  • Example: method overloading in Java.

  • Runtime polymorphism is also known as dynamic polymorphism.

  • It is achieved by having a method in a superclass and a method with the same signature ...read more

Add your answer
right arrow

Q2. how to handle exception in spring boot?

Ans.

Exceptions in Spring Boot can be handled using try-catch blocks, @ExceptionHandler annotation, and global exception handling.

  • Use try-catch blocks to handle exceptions within a specific method.

  • Use @ExceptionHandler annotation to handle exceptions at the controller level.

  • Implement a global exception handler using @ControllerAdvice and @ExceptionHandler annotations.

  • Customize error responses using ResponseEntityExceptionHandler.

  • Use @ResponseStatus annotation to specify the HTTP s...read more

View 1 answer
right arrow

Q3. what is a classLoader?

Ans.

A classLoader is a part of the Java Runtime Environment that dynamically loads Java classes into the Java Virtual Machine.

  • ClassLoader is responsible for loading classes at runtime in Java.

  • It follows a delegation hierarchy to search for classes.

  • There are different types of class loaders like Bootstrap, Extension, and System class loaders.

  • Custom class loaders can be created to load classes from different sources like network or database.

Add your answer
right arrow

Q4. what is Polymorphism?

Ans.

Polymorphism is the ability of an object to take on multiple forms.

  • Polymorphism allows objects of different classes to be treated as objects of a common superclass.

  • There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).

  • Example: Animal superclass with Dog and Cat subclasses, both overriding the makeSound() method.

Add your answer
right arrow
Discover TCS interview dos and don'ts from real experiences

Q5. What is constructor?

Ans.

Constructor is a special method that is used to initialize objects in Java.

  • Constructor has the same name as the class name

  • It does not have a return type

  • It can be overloaded

  • It is called automatically when an object is created

  • Example: public class Car { public Car() { // constructor code here } }

Add your answer
right arrow

Q6. what is Truncate

Ans.

Truncate is a SQL command used to delete all rows from a table without logging the individual row deletions.

  • Truncate is a DDL (Data Definition Language) command in SQL.

  • It is used to quickly delete all rows from a table, but it does not log individual row deletions.

  • Truncate is faster than using the DELETE command, as it does not generate individual row deletion logs.

  • Truncate also resets any auto-incrementing keys in the table.

  • Example: TRUNCATE TABLE table_name;

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at TCS Java Developer for Freshers

based on 12 interviews
3 Interview rounds
Technical Round
Coding Test Round
HR Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Java Developer Interview Questions from Similar Companies

Deloitte Logo
3.8
 • 34 Interview Questions
LTIMindtree Logo
3.8
 • 32 Interview Questions
ITCS Logo
3.3
 • 11 Interview Questions
View all
Recently Viewed
INTERVIEWS
TCS
Fresher
10 top interview questions
INTERVIEWS
NeoSOFT
10 top interview questions
REVIEWS
Tata Motors
No Reviews
INTERVIEWS
ITC Infotech
10 top interview questions
INTERVIEWS
HCLTech
No Interviews
REVIEWS
Tata Motors
No Reviews
INTERVIEWS
Cognizant
20 top interview questions
INTERVIEWS
ClickSoftware
10 top interview questions
INTERVIEWS
Acma Computers
No Interviews
INTERVIEWS
DXC Technology
No Interviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter