Java Developer Trainee
10+ Java Developer Trainee Interview Questions and Answers for Freshers

Asked in Feathersoft Info Solutions

Q. How can you find the lowest number from an ArrayList using streams?
Find the lowest number from an arraylist using streams
Use stream.min() method to find the lowest number
Pass Comparator.naturalOrder() to get the lowest number
Handle empty list scenario using OptionalInt

Asked in Corpus Enterprises Private Limited

Q. Write a program using control flow statements to create two objects based on user input.
Create two objects based on user input using control flow statements in Java.
Use Scanner class to take user input
Use if-else or switch statements to create objects based on input
Instantiate objects with appropriate constructors

Asked in Corpus Enterprises Private Limited

Q. What is map? Explain about collection hierarchy
Map is an interface in Java that maps unique keys to values.
Map is a part of the Java Collections Framework
It is used to store key-value pairs
Some common implementations of Map are HashMap, TreeMap, and LinkedHashMap

Asked in Feathersoft Info Solutions

Q. Demonstrate inheritance in Java with code.
Inheritance in Java allows a class to inherit properties and methods from another class.
Use the 'extends' keyword to create a subclass that inherits from a superclass
The subclass can access all public and protected members of the superclass
Example: class Dog extends Animal { ... }
The 'super' keyword is used to call the superclass constructor or method

Asked in Feathersoft Info Solutions

Q. How do you configure the server port in a Spring Boot application?
To configure server port in a Spring Boot app, modify the application.properties file.
Open the application.properties file
Add the following line: server.port=8080 (or any desired port number)
Save the file and restart the application

Asked in Feathersoft Info Solutions

Q. Abstract and anonymous classes in java
Abstract classes are incomplete classes that cannot be instantiated. Anonymous classes are unnamed classes that can be created on the fly.
Abstract classes are declared with the 'abstract' keyword and can have abstract and non-abstract methods.
Anonymous classes are created using the 'new' keyword and can extend a class or implement an interface.
Anonymous classes are often used for event handling and callbacks.
Example of abstract class: abstract class Shape { abstract void draw...read more

Asked in Feathersoft Info Solutions

Q. Write a function to find duplicate characters in a string.
Program to find duplicate alphabets in a string
Create a HashMap to store the frequency of each alphabet
Iterate through the string and update the frequency in the HashMap
Iterate through the HashMap and print the alphabets with frequency greater than 1

Asked in BMC Software

Q. Given a string, reverse the order of its characters and return the reversed string.
Reverse a given string
Iterate through the string from end to start and append each character to a new string
Use StringBuilder or StringBuffer for better performance
Convert the string to a character array and swap the first and last characters, then move towards the middle until the entire string is reversed
Share interview questions and help millions of jobseekers 🌟

Asked in Feathersoft Info Solutions

Q. Write a function to find all vowels in a given string.
A Java program to find vowels from a given string.
Create a string variable and initialize it with the given string.
Use a for loop to iterate through each character of the string.
Check if the character is a vowel using if statement and add it to a new string variable.
Print the new string variable containing all the vowels.

Asked in Feathersoft Info Solutions

Q. Explain the role of a controller in Spring.
Controller in Spring is responsible for handling user requests and returning appropriate responses.
Controller receives requests from the client and delegates them to appropriate handlers
It maps the incoming requests to the corresponding handler methods
It returns the response to the client after processing the request
It can also handle exceptions and errors that occur during request processing

Asked in Mindteck

Q. Write a program to merge two arrays.
Merging two arrays of strings in Java.
Create a new array with size equal to the sum of sizes of both arrays.
Copy elements of first array to the new array.
Copy elements of second array to the new array starting from the end of first array.
Return the new array.

Asked in Feathersoft Info Solutions

Q. What is the use of refresh scope?
Refresh scope is used in Spring framework to control the lifecycle of beans.
Refresh scope is used to create a new instance of a bean every time it is requested.
It is useful when the state of a bean needs to be reset on every request.
To use refresh scope, add @RefreshScope annotation to the bean definition.
Example: @Bean @RefreshScope public MyBean myBean() { return new MyBean(); }
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Java Developer Trainee Related Skills



Reviews
Interviews
Salaries
Users

