Java Software Engineer

filter-iconFilter interviews by

Java Software Engineer Interview Questions and Answers for Freshers

Updated 18 Sep 2021

Popular Companies

search-icon

Q1. Can we pass values during object creation?

Ans.

Yes, we can pass values during object creation using constructors.

  • Constructors are special methods that are called when an object is created.

  • They can take parameters to initialize the object's state.

  • Values passed during object creation are used to initialize instance variables.

  • Example: public class Person { String name; int age; public Person(String name, int age) { this.name = name; this.age = age; } }

  • Example usage: Person person = new Person("John", 30);

Q2. what are exceptions. How many times are there?

Ans.

Exceptions are errors that occur during program execution. There are two types: checked and unchecked.

  • Exceptions are objects that represent errors or exceptional conditions that occur during program execution.

  • Checked exceptions are checked at compile time and must be handled or declared in the method signature.

  • Unchecked exceptions are not checked at compile time and can be handled or left to propagate up the call stack.

  • Examples of exceptions include NullPointerException, Arra...read more

Q3. Explain OOP concepts in Java with real time examples?

Ans.

OOP concepts in Java with real time examples

  • Encapsulation - hiding implementation details of a class. Example: private variables in a class

  • Inheritance - creating a new class from an existing class. Example: subclass extending a superclass

  • Polymorphism - ability of an object to take many forms. Example: method overloading and overriding

  • Abstraction - showing only necessary details to the user. Example: abstract classes and interfaces

Q4. Differentiate between Array and Array list in detail with example?

Ans.

Array is a fixed-size data structure while Array list is a dynamic data structure.

  • Array has a fixed size while Array list can grow dynamically.

  • Array can store only homogeneous data types while Array list can store heterogeneous data types.

  • Array is faster than Array list in terms of accessing elements.

  • Array list provides more functionality like add, remove, and search.

  • Example of Array: int[] arr = new int[5]; Example of Array list: ArrayList list = new ArrayList<>();

Are these interview questions helpful?

Q5. What is Daemon Thread?Give example

Ans.

Daemon thread is a low priority thread that runs in the background and provides services to user threads.

  • Daemon threads are used for tasks that don't require user interaction, such as garbage collection.

  • They can be created using setDaemon() method.

  • They terminate automatically when all user threads have finished execution.

  • Example: Timer thread in Java is a daemon thread.

Q6. What is use of static keyword?

Ans.

Static keyword is used to create class-level variables and methods.

  • Static variables are shared among all instances of a class

  • Static methods can be called without creating an instance of the class

  • Static blocks are used to initialize static variables

  • Static import is used to import static members of a class

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. Explain collection framework In depth

Ans.

Collection framework is a set of classes and interfaces that provide a way to store and manipulate groups of objects.

  • Collection framework is part of Java's core libraries.

  • It includes interfaces like List, Set, and Map, and their respective implementations like ArrayList, HashSet, and HashMap.

  • Collections can be sorted, searched, and filtered using various methods.

  • Iterators are used to traverse through collections.

  • Collections can also be synchronized for thread safety.

  • Example: ...read more

Q8. Method overloading vs Methodoverriding

Ans.

Method overloading is having multiple methods with the same name but different parameters. Method overriding is having a method in child class with the same name and signature as in parent class.

  • Method overloading is compile-time polymorphism

  • Method overriding is run-time polymorphism

  • Method overloading is used to provide different ways of calling the same method

  • Method overriding is used to provide a specific implementation of a method in a child class

  • Method overloading can hav...read more

Java Software Engineer Jobs

Java Software Engineer 2-7 years
IBM India Pvt. Limited
4.0
Kochi
Lead Consultant- Java Software Engineer 5-8 years
AstraZeneca India Pvt. Ltd
4.1
Chennai
PRINCIPAL, SOFTWARE ENGINEER (Java) 7-11 years
Walmart Labs
3.7
Bangalore / Bengaluru

Q9. Current CTC

Ans.

The current CTC (Cost to Company) is the total salary package of an employee including all benefits and allowances.

  • CTC includes salary, bonuses, incentives, and other monetary benefits.

  • It also includes non-monetary benefits like health insurance, retirement plans, and company-provided facilities.

  • CTC is used to calculate the net salary after deducting taxes and other deductions.

  • It is an important factor for job seekers to evaluate job offers and negotiate salaries.

  • Example: Cur...read more

Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.8
 • 8.2k Interviews
3.6
 • 7.6k Interviews
3.7
 • 5.6k Interviews
3.5
 • 3.8k Interviews
3.4
 • 796 Interviews
3.8
 • 510 Interviews
3.5
 • 376 Interviews
3.6
 • 363 Interviews
4.9
 • 151 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Recently Viewed
REVIEWS
Wunderman Thompson Commerce
No Reviews
INTERVIEWS
SLMG Beverages
No Interviews
REVIEWS
Wunderman Thompson Commerce
No Reviews
INTERVIEWS
SLMG Beverages
No Interviews
SALARIES
Wunderman Thompson Commerce
No Salaries
LIST OF COMPANIES
Wunderman Thompson Commerce
Locations
JOBS
Wunderman Thompson Commerce
No Jobs
SALARIES
Wunderman Thompson Commerce
LIST OF COMPANIES
Discover companies
Find best workplace
SALARIES
Wunderman Thompson Commerce
Java Software Engineer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

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