Java Software Engineer

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-6 years
Wipro Limited
3.7
Noida
Java Software Engineer 5-8 years
Wipro Limited
3.7
Bangalore / Bengaluru
Software Engineer (Java) 2-5 years
Digient Technologies
4.4
Chennai

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.9
 • 7.8k Interviews
3.7
 • 7.3k Interviews
3.7
 • 5.2k Interviews
3.6
 • 3.6k Interviews
3.4
 • 771 Interviews
3.8
 • 492 Interviews
3.6
 • 399 Interviews
3.6
 • 337 Interviews
5.0
 • 144 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

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
Get AmbitionBox app

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