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. |
|
| ||||
Interview Questions and Answers - Order By Newest | ||||
| ||||
Ans. No Difference. Both are the acceptable ways to declare an array. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   array   arrays   array declaration   difference between Asked in 3 Companies basic | ||||
| ||||
Ans. By having Null Checks. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  exceptions   npe   nullpointerexception   null checks basic   frequent | ||||
| ||||
Ans. Final makes sure that the value doesn't change after initialization and static makes sure that there is only one copy that can be shared across objects. Making it non static will unnecessarily create a different copy per object wherein the same value will kept for all copies ( as its final and cannot be changed ). | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   static   final variables   variable constants basic   frequent | ||||
| ||||
Ans. Criteria is a simplified API for retrieving entities by composing Criterion objects. For example - session.createCriteria(Employee.class).add( Restrictions.like("name", "A%") ).list(); will return all employee objects having name starting with A. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  hibernate   hibernate criteria Asked in 7 Companies Basic   Frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. It is a continuous integration tool written in Java. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   jenkins Asked in 6 Companies Basic   frequent | ||||
| ||||
Ans. float is a native data type whereas Float is a class. A Float object will always take more memory than float variable as there are metadata overheads with the objects. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   data type   float Asked in 3 Companies basic   frequent | ||||
| ||||
Ans. HashMap | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   map  hashtable Asked in 2 Companies basic   frequent | ||||
| ||||
Ans. Prefix operator performs the increment and then assignment whereas its inverse for postfix operator. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  prefix increment operator   postfix increment operator   operators   java basic   frequent | ||||
| ||||
Ans. [Open Ended Answer] This is a very sensitive question and should be dealt with caution. Just simply saying that you never had any disagreement will present you as dumb team member. Showing your self as too aggressive in such decisions will present you as a trouble maker. You should present a situation where you had an argument / disagreement but eventually you and your team mates mutually found a way out of it. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 20 Companies basic | ||||
Frequently asked in face to face interviews. | ||||
| ||||
Ans. int count = 15; int[] fibonacci = new int[count]; fibonacci[0] = 0; fibonacci[1] = 1; for(int x=2; x < count; x++){ fibonacci[x] = fibonacci[x-1] + fibonacci[x-2]; } for(int x=0; x< count; x++){ System.out.print(fibonacci[x] + " "); } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  ebay   fibonacci series Asked in 66 Companies basic   frequent | ||||
Must know at all levels. Among Top 10 frequently asked questions in Java. Very frequently asked to fresh graduates or less experienced professionals. | ||||
| ||||
Ans. Its a facility for code reuse and independent extension wherein a derived class inherits the properties of parent class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  inheritance  object oriented programming (oops)  oops concepts  oops concepts  java concepts  code reuse  code re-use   classes  derived classes Asked in 14 Companies basic   frequent | ||||
| ||||
Ans. A Java bean is a class which abides by following conventions: Core of the object is member elements and not operations ( methods ) Member Elements can be accessed by getters (and setters if those properties are not read-only). serializable. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java bean   javabean   pojo   classes basic   frequent | ||||
| ||||
Ans. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  static polymorphism  object oriented programming (oops)  oops concepts   dynamic polymorphism  object oriented programming (oops)  oops concepts   polymorphism  object oriented programming (oops)  oops concepts   overloading   overriding   broadridg Asked in 1 Companies basic   frequent | ||||
| ||||
Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=946 | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  code  coding  scanner basic | ||||
Very frequently asked to fresh graduates. Frequently asked in NSEiT and Accenture India | ||||
| ||||
Ans. public class Main { public static void main(String args[]) { int number = 2; int count = 0; long sum = 0; int givenNumber = 1000; while (count < givenNumber) { if (isPrimeNumber(number)) { sum = number; count; } number; } System.out.println(sum); } private static boolean isPrimeNumber(int number) { for (int i = 2; i <= number / 2; i) { if (number % i == 0) { return false; } } return true; } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  generate prime numbers  code  coding Asked in 5 Companies basic   frequent | ||||
| ||||
Ans. public class Factorial { public static void main(String[] args){ int x = 5; System.out.println(calculateFactorial(x)); } private static int calculateFactorial(int x){ if(x==1){ return 1; } return x * calculateFactorial(x-1); } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  factorial  calculate factorial  code  coding  recursion Asked in 1 Companies basic | ||||
| ||||
Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=965 | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  constructor overloading  code  coding Asked in 2 Companies basic | ||||
| ||||
Ans. Destructor is used to de-allocate memory allocated by objects. There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  destructor  garbage collection Asked in 11 Companies Basic   frequent | ||||
Try 1 Question(s) Test | ||||
Frequently asked. | ||||
| ||||
Ans. It should either implement all interface methods or declare unimplemented methods as abstract. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  interfaces Asked in 1 Companies Basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. It should either implement the abstract methods or re-declare them abstract. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  abstract class Asked in 2 Companies Basic   Frequent | ||||
| ||||
Ans. 1. Function Local Variables 2. Instance Variables 3. Class variables or static variables | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  variables Asked in 1 Companies basic   frequent | ||||
Frequently asked to Fresh graduates. | ||||
| ||||
Ans. http://algs4.cs.princeton.edu/11model/BinarySearch.java.html | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  binary search  search Asked in 5 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. TreeSet and TreeMap are used for maintaining sorted elements. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  ordered collections  sorted collections Asked in 1 Companies basic   frequent | ||||
| ||||
Ans. Stored procedures are a batch of SQL statements along with programming constructs ( if else, loops etc ) and stored as a single program that can be called by different clients and hence reused. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  database  stored procedure Asked in 2 Companies basic   frequent | ||||
Very Frequently asked to fresh graduates and less experienced. | ||||
| ||||
Ans. Abstraction Polymorphism Inheritance Encapsulation | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  oops  oops concepts Asked in 1 Companies basic   frequent | ||||
| ||||
Ans. An Internet Protocol address is a numerical label assigned to each device participating in a computer network. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  ip address Asked in 2 Companies basic   frequent | ||||
All these acronyms JDK,JRE,JVM etc are very frequently asked. | ||||
| ||||
Ans. JRE or Java Runtime Environment is the Java Virtual Machine on which class files are executed. It includes borwser plugins that facilitates execution of class files in browsers. JDK or Java Development Kit includes JRE , compiler and development tools. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  JDK  JRE  JDK vs JRE  Difference between Asked in 4 Companies basic   frequent | ||||
| ||||
Ans. CRUD stands for "Create, read, update and delete" are the basic functions of persistence. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  CRUD  Persistence  Database  Database Operations Asked in 3 Companies Basic   frequent | ||||
| ||||
Ans. DTO is Data Transfer Object i.e Pojo which is supposed to move between different layers of software architecture for transferring information. Example could be the object passed from client in case of web service call or the object passed to Persister for Database Persistence. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  DTO   Data Transfer Object basic   frequent | ||||
| ||||
Ans. DAO is Data Access Object which is used within Persistence Layer to make Database Transaction. For example , the class holding the Database connection and CRUD methods. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  DAO  Data Access Object basic   frequent | ||||