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
 Q1651. Can we use java keywords as identifiers ?Core Java
Ans. No, keyword has pre defined meaning for compiler and hence cannot be used as identifiers.

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

   Like         Discuss         Correct / Improve     keywords  identifier


 Q1652. What is the importance of Abstract Class ?Core Java
Ans. Abstract classes provide a mechanism of interfacing ( using abstract method ) as well as code reuse through inheritance ( extending abstract class )

Comparing to concrete class they have an advantage of providing interface which a concrete class doesn't provide.

Comparing to interfaces they have an advantage of providing code reuse through inheritance which interfaces dont provide.

  Sample Code for abstract class

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

   Like         Discuss         Correct / Improve     abstract class  importance of abstract class      Basic        frequent


 Q1653. Can we use true and false as identifiers in java ? Are they keywords in Java ?Core Java
Ans. true and false are literals in java. No we cannot use them as identifiers.

  Sample Code for literal

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

   Like         Discuss         Correct / Improve     identifiers  keywords  literals


 Q1654. What are the some literals in java that are reserved and hence cannot be used as identifiers ? Core Java
Ans. true , false and null

  Sample Code for literals

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

   Like         Discuss         Correct / Improve     literals


 Q1655. What is Executor Framework in 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     executor framework


 Q1656. What is the use of java.util.concurrent package 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     java.util.concurrent


 Q1657. How is garbage collection in Java 8 different from Java 7 ? 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     memory management  garbage collection


 Q1658. How can you extract integers from string values and add (sum it up) all the extracted integers? e.g "James34long4island322in3rdAvenue" ---> 34 4 322 3 = 363Core Java
 This question was recently asked at 'Horizon 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     coding  code     Asked in 1 Companies


 Q1659. Which of the two - compile time and run time polymorphism - requires signature of the method to be different ?Core Java
Ans. runtime polymorphism or method overriding doesn't require method name and signature to be different whereas compile time polymorphism or method overloading requires method name to be same but the signature to be different.

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

   Like         Discuss         Correct / Improve     polymorphism  object oriented programming (oops)  oops concepts  overloading  overriding      basic


 Q1660. Write a class and override the equals and hashcode method ?Core Java
Ans. class Student
{
///
///
///
private int id;
private String name;

///
///
///
public Student(int id, String name)
{
this.name = name;
this.id = id;

}// Student

///
///
///
public int getId()
{
return id;

}// getId

///
///
///
public void setId(int id)
{
this.id = id;

}// setId

///
///
///
public String getName()
{
return name;

}// getName

///
///
///
public void setName(String name)
{
this.name = name;

}// setName

@Override
public boolean equals(Object obj)
{
if (obj == null) return false;
if (!(obj instanceof Student))
return false;
if (obj == this)
return true;

return this.getId() == ((Student) obj).getId();

}// equals

///
///
///
@Override
public int hashCode()
{
return this.getId();

}// hashCode

}// Student

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q1661. Whats is the difference between Spring MVC and Spring Restful webservice ?Spring
 This question was recently asked at 'CapTech'.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


 Q1662. which one do you prefer - JDBC or Hibernate ?Database
 This question was recently asked at 'Captech'.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


 Q1663. Which component of MVC you like to work on ?Java EE
 This question was recently asked at 'CapTech'.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


 Q1664. Which type of projects have you worked on ?General
 This question was recently asked at 'Horizon 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 1 Companies


 Q1665. Which tools have you used in your previous projects ?General
 This question was recently asked at 'Horizon 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 1 Companies


 Q1666. What are your short and long terms goals ?General
 This question was recently asked at 'Horizon 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 1 Companies


 Q1667. Write a Program to convert a binary to number ?Core Java
Ans. int convert(int binaryInt) {
int sumValue=0;
int multiple = 1;
while(binaryInt > 0) {
binaryDigit = binaryInt;
binaryInt = binaryInt /10;
sumValue = sumValue (binaryDigit * multiple);
multiple = multiple * 2;
}

return sumValue;
}

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

   Like         Discuss         Correct / Improve     code  coding     Asked in 1 Companies      basic


 Q1668. What are protocol buffers ?Markup Language
Ans. Protocol buffers are language-neutral, platform-neutral, mechanism for serializing structured data. It is developed by google.

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

   Like         Discuss         Correct / Improve     protocol buffer


 Q1669. Can we discover end points of Rest API without looking at the code ?Rest
Ans. Generally Rest services don't have any registry like we have WSDL is SOAP and hence don't have a way to know the end points without looking at either the url mapping in controller or client code. Some restful service publish WADL (Web Application Description Language) and hence clients can locate the service end points.

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

   Like         Discuss         Correct / Improve     rest api endpoints


 Q1670. Can we deploy an application to server using a jar file ?Java EE
Ans. Conventionally we need a WAR file to be deployed to server. Though with Spring Boot we can even deploy using jar.

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

   Like         Discuss         Correct / Improve     


 Q1671. What is the use of Annotations in Java ?Core Java
Ans. Annotations are used to specify meta information about the code.

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

   Like         Discuss         Correct / Improve     Annotations


 Q1672. Are Annotations better than using XML configs ?Core Java
Ans. Yes , as both code and its meta information reside in the same file, it promotes better readability and maintenability.

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

   Like         Discuss         Correct / Improve     Annotations


 Q1673. Why is goto not used in Java?Core Java
Ans. Goto statement results in unstructured jumps in control from one code location to another and hence makes the code very difficult
to read , maintain and debug. Moreover Goto can always be replaced using other statements like break / continue and hence results in structured movement of programming control.

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

   Like         Discuss         Correct / Improve     goto  keywords


 Q1674. What is "convention over configuration" ? Which framework uses this design paradigm ?Design
Ans. Convention over configuration is a way of software design used by frameworks that attempt to decrease the number of decisions that a developer is required to make without necessarily losing flexibility. The objective is to reduce the unnecessary configurations and follow conventions to accomplish that. For example - DB Entity and DB Table name conventionally should be same and hence shouldn't require configuring mapping between the two.

"Spring Boot" and "Ruby on Rails" have adopted this design principle.

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

   Like         Discuss         Correct / Improve     Convention over configuration     Asked in 1 Companies


 Q1675. Are there any disadvantages of "Convention over configuration" Design paradigm ?Design
Ans. Yes, It may result in some loss of flexibility as the application has to follow all conventions. Moreover it can contradict with other design paradigms or principles used in the application or framework.

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

   Like         Discuss         Correct / Improve     Convention over configuration


 Q1676. Can you give an example of "Convention over configuration" Design principle ?Design
Ans. Hibernate mapping configurations are used for mapping hibernate entities and corresponding DB Tables. Conventionally Entities and Table can share the same name and hence framework can provide implicit mapping instead of explicit mapping through configurations. Though it may result in little loss of flexibility in extreme cases but will work with all applications following the convention.

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

   Like         Discuss         Correct / Improve     Convention over configuration


 Q1677. Explain Interceptor Design Pattern ?Design
Ans. It is used for intercepting the request. It's primary use is to implement security policy. All or specific request types can be intercepted and hence forwarded to authentication / authorization module so as to facilitate authorized requests to application.

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

   Like         Discuss         Correct / Improve     interceptors  interceptor design pattern


 Q1678. What are the changes in Java 9 ?Core Java
Ans. JVM and JDK are getting smaller.

New command line tool called jshell that will add native support and popularize a Java way to REPL (Read-Eval-Print-Loop)

private methods in interfaces

Introduction of the module system or project Jigsaw

JavaDoc Search

Light version of JSON API

HTTP2 client



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

   Like         Discuss         Correct / Improve     Java 9  Java9  changes in Java 9     Asked in 1 Companies


 Q1679. What are the disadvantages of Adapter Design Pattern ?Design
Ans. It introduces a layer of adaptations before it reaches the final and desired interface.

Moreover sometimes all requests are forwarded to adapter class. Some of such requests doesn't even require any sort of adaptions as they are qualified to call the final interface directly and introducing overheads.

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

   Like         Discuss         Correct / Improve     Adapter Design Pattern  design pattern


 Q1680. What could be the real world example of Adapter Design Pattern ?Design
Ans. Voltage converters / Power Adapters

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

   Like         Discuss         Correct / Improve     Adapter Design Pattern  Design Pattern


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: