Interview Questions and Answers for 'A' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

   next 30
 Q2401. Will this give compile time error ?

Object[] strArray = new String[2];
strArray[0] = 5;
Core Java
Ans. No. But It will throw ArrayStoreException at runtime.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ArrayStoreException  arrays


 Q2402. Have you ever had problems with SCM checkouts or tagging while doing release build in Maven ?Maven
Ans. Yes Sometimes due to caching , conflicting tags , or incorrect scm info within pom.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2403. How do you branch your code within SCM ?SCM
Ans. We keep a Working Branch , Release Branch and Master.

Working Branch is what we work on. We release from the release branch.

So the flow for merge is

Work Branch -> Release Branch -> Master

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     source code management  scm  svn  git  scm branching


 Q2404. Do you think it's a good practice to perform releases from a branch and then merge code to the master ?SCM
Ans. We have followed this practice in one of the project. The only downside we felt was the need to merge the new snapshot version to master after the release.

The Benefit is that it's easy to just ignore the branch if complete rollback happens and hence master remains in sync with production.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     source code management  scm  svn  git  release process


 Q2405. Find all files from a directory (including sub directories ) that could contain dates in a specific format.Unix
 This question was recently asked at 'Hitachi'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2406. Are you willing to spend long hours ?General
Ans. why not if getting money in dollars!

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q2407. In what terms Java is better language than c and c++ ?
Ans. Java manages pointers intrinsically and gives no control over pointer arithmetic to coders and hence saves the applications from many possible problems like dangling pointers and memory leaks.

Java is platform independent and hence any application can be run on any hardware with the suitable JVM without building it separately for different hardwares.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2408. What is TypeCasting ?Core Java
Ans. Assigning a value of one type to a variable of another type is known as Type Casting.

Example :

int x = 10;
byte y = (byte)x;

In Java, type casting is classified into two types, Widening Casting(Implicit) widening-type-conversion and Narrowing Casting (Explicitly done) narrowing-type-conversion.

Widening or Automatic type converion - Automatic Type casting take place when,the two types are compatible and the target type is larger than the source type

Example :

public class Test {
public static void main(String[] args) {
int i = 100;
long l = i; //no explicit type casting required
float f = l;//no explicit type casting required
System.out.println("Int value " i);
System.out.println("Long value " l);
System.out.println("Float value " f);
}
}

Narrowing or Explicit type conversion - When you are assigning a larger type value to a variable of smaller type, then you need to perform explicit type casting.

Example :

public class Test{
public static void main(String[] args) {
double d = 100.04;
long l = (long)d; //explicit type casting required
int i = (int)l;//explicit type casting required
System.out.println("Double value " d);
System.out.println("Long value " l);
System.out.println("Int value " i);
}
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     typecasting  type casting     Asked in 23 Companies


 Q2409. What is the biggest Design problem in Java ?Core Java
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2410. What is Bastion host ?Infrastructure
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Amazon Web Service (AWS)


 Q2411. How do you usually choose which type of EC2 Instance you would like to Use ?Amazon Web Services (AWS)
Ans. Depend on its pricing module

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws ec2  aws computing  amazon cloud computing  amazon ec2


 Q2412. Write a java program to find the maximum profit in day tradingCore Java
 This question was recently asked at 'Capital One'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2413. What are basic functions of OOPS ?Core Java
 This question was recently asked at 'Zillious'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2414. Where to use interface and abstract class ?Core Java
 This question was recently asked at 'Exterro,Equator Business Solutions'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q2415. Does Java SE has Immutable collections ?Core Java
Ans. Yes wef from Java 9

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java 9  java9  immutable  immutability collections


 Q2416. Can you write immutable class without final?Core Java
Ans. By making the constructor private

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2417. What is the difference between Singleton and immutable?Design
Ans. Singleton class will have only one instance through out your application. Once the instance has been created, you can use it to change the state of that object, whereas for immutable class you cannot change the value that means you cannot change the state of it once assigned.

If you want to change the state/ different values, you can very well create two instance for that immutable class which JVM will allow.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2418. Is java fully platform independent ?Core Java
Ans. yes, Java is a class-based and object-oriented programming language. It is a platform-independent language i.e. the compiled code can be run on any java supporting platform. It runs on the logic of “Write once, run anywhere”.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2419. Which s/w is used for adhar card verification for amount transfer?
Ans. The Aadhaar enabled Payment System or AePS

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2420. Can we use try within catch block ?Core Java
Ans. Yes

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2421. What are the features of Spring Framework ?Spring
Ans. Core technologies: dependency injection, events, resources, i18n, validation, data binding, type conversion, SpEL, AOP.

Testing: mock objects, TestContext framework, Spring MVC Test, WebTestClient.

Data Access: transactions, DAO support, JDBC, ORM, Marshalling XML.

Spring MVC and Spring WebFlux web frameworks.

Integration: remoting, JMS, JCA, JMX, email, tasks, scheduling, cache.

Languages: Kotlin, Groovy, dynamic languages.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q2422. Isnt the use of HashTable and ConcurrentHashMap the same, i.e providing synchronized map collection ?Core Java
Ans. Both provide the thread safety but the actual difference come when talk about performance. CHM gives best performance when no of writer threads are less in number.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     synchronized collections  hashtable  ConcurrentHashMap     Asked in 1 Companies


 Q2423. Tell me about thread pool?Design
Ans. Java provides its own implementations of the thread pool pattern, through objects called executors. These can be used through executor interfaces or directly through thread pool implementations which does allow for finer-grained control. The java.util.concurrent package contains the following interfaces:

Executor : a simple interface for executing tasks.ExecutorService a more complex interface which contains additional methods for managing the tasks and the executor itself.

ScheduledExecutorService: extends ExecutorService with methods for scheduling the execution of a task.Alongside these interfaces, the package also provides the Executors helper class for obtaining executor instances, as well as implementations for these interfaces.

Generally, a Java thread pool is composed of:

The pool of worker threads, responsible for managing the threads.
A thread factory that is responsible for creating new threads.
A queue of tasks waiting to be executed.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     thread pool     Asked in 1 Companies


 Q2424. What is the purpose of doing mvn eclipse:eclipse or man idea:ideaMaven
Ans. It is an instruction to maven to set up files ( class path , project ) within the IDE

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     IDE  eclipse  intelliJ  Maven


 Q2425. How can we request maven to set up class path within the IDEMaven
Ans. We can do mvn eclipse:eclipse or mvn idea:idea depending on the type of IDE

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     IDE  Maven


 Q2426. Will it print the message in Base Class constructor if we execute main method of Main class ? why ?

public class BaseClass {
BaseClass(){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}
Core Java
Ans. Yes.

When the Derived class constructor is initialized , a no argument super will be called intrinsically.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     constructor


 Q2427. What will the following print upon executing main method of Main class ?

public class BaseClass {
BaseClass(){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
System.out.println("Hello I am in Derived Class Constructor");
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}
Core Java
Ans. Hello I am in Base Class Constructor
Hello I am in Derived Class Constructor

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     constructor


 Q2428. What will the following code print upon executing main method of Main class ?

public class BaseClass {
BaseClass(){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
System.out.println("Hello I am in Derived Class Constructor");

super();
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}

Core Java
Ans. There will be compilation error within constructor of Derived Class as "super must be the first statement in constructor body".

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     constructor


 Q2429. What will the following code print upon executing main method of Main class ?

public class BaseClass {
BaseClass(int x){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
System.out.println("Hello I am in Derived Class Constructor");
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}
Core Java
Ans. Compilation error as there is no default constructor available in BaseClass.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     constructor


 Q2430. What will the following code print upon executing main method of Main class ?

public class BaseClass {
BaseClass(int x){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
super(1);
System.out.println("Hello I am in Derived Class Constructor");
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}
Core Java
Ans. Hello I am in Base Class Constructor
Hello I am in Derived Class Constructor

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     constructor


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: