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. JSON is "JavaScript Object Notation", primarily used for client-server or server-server communication. Its a much lighter and readable alternative to XML. JSON is language independent and is easily parse-able in all programming languages. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  json   markup language   client server communication Asked in 26 Companies basic   frequent | ||||
Try 2 Question(s) Test | ||||
| ||||
Ans. An API is a kind of technical contract which defines functionality that two parties must provide: a service provider (often called an implementation) and an application. an API simply defines services that a service provider (i.e., the implementation) makes available to applications. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  j2ee   api   java basic   frequent | ||||
| ||||
Ans. URL is Uniform Resource Locator which is representation of HTTP address. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  j2ee   http   internet   url basic   rare | ||||
| ||||
Ans. HTTP or Hypertext Transfer Protocol is internet protocol for tranmission of hypertext ( text with meta data ) over internet. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  j2ee   http   internet  fidelity Asked in 2 Companies basic   frequent | ||||
| ||||
Ans. For top level class we can only use "public" and "default". We can use private with inner class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   class   access specifier   inner classes basic   frequent | ||||
| ||||
Ans. Threads in Java can be implement either by Extending Thread class or implementing runnable interface. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   threads   multi threading Asked in 1 Companies basic   frequent | ||||
| ||||
Ans. A Method that cannot be overriden in the sub class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   java keywords   final   final method   overriding   basic interview question basic   frequent | ||||
Try 1 Question(s) Test | ||||
Very Frequently asked.Favorite question in Walk in drive for many Indian service companies. | ||||
| ||||
Ans. A Class that cannot be sub classed. | ||||
Sample Code for final class | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   final   final class   java keyword   basic interview question Asked in 3 Companies basic   frequent | ||||
Very frequently asked. Usually asked with questions related to String. Frequently asked at CTS / Cognizant | ||||
| ||||
Ans. Object that can't be changed after instantiation. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   immutable  immutability Asked in 27 Companies basic   frequent | ||||
Try 2 Question(s) Test | ||||
| ||||
Ans. IndexOutofBoundException , NoClassDefFoundException , OutOfMemoryException , IllegalArgumentException, NullPointerException, IllegalStateException | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   exceptions   basic interview question basic   frequent | ||||
| ||||
Ans. By putting it within finally. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   exceptions   finally   uncatched exceptions basic   frequent | ||||
| ||||
Ans. Used to access members of the base class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   java keywords   super   basic interview question Asked in 2 Companies basic   frequent | ||||
| ||||
Ans. Used to represent an instance of the class in which it appears. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   java keywords   this   basic interview question basic   frequent | ||||
| ||||
Ans. boolean is a primitive type whereas Boolean is a class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   wrapper classes   boolean vs Boolean basic   rare | ||||
| ||||
Ans. Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   serialization   deserialization   serialization vs deserialization Asked in 2 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. An enum type is a special data type that enables for a variable to be a set of predefined constants | ||||
Sample Code for enum | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   java5   enum   basic interview question basic   frequent | ||||
Try 2 Question(s) Test | ||||
| ||||
Ans. By static import , we can access the static members of a class directly without prefixing it with the class name. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   java5   static import   static   java keyword   static import Asked in 4 Companies basic   frequent | ||||
| ||||
Ans. Map is an interface where HashMap is the concrete class. | ||||
Sample Code for map Sample Code for hashmap | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   hashmap   map basic   frequent | ||||
Frequently asked to fresh graduates. | ||||
| ||||
Ans. Its an interpretor. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   jvm   compiler   interpretor basic   frequent | ||||
| ||||
Ans. It should be followed by either catch or finally block. | ||||
Sample Code for Retry in case of exception | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   exceptions   exception handling   try   catch   finally  Oracle OCA Test Asked in 3 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. Inner class is a type of nested class. Inner classes are non static nested classes i.e the one that are associated with the instance of outer class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   static   nested classes   inner classes   nested vs inner class basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. Collections class is a utility class having static methods for doing operations on objects of classes which implement the Collection interface. For example, Collections has methods for finding the max element in a Collection. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   collections class   collection interface   basic interview question Asked in 6 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. XML or eXtensible Markup Language is a markup languages for describing data and its metadata. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  xml   markup language basic   frequent | ||||
Frequently asked in CTS ( Based on 2 feedback ) | ||||
| ||||
Ans. Comparable interface is used for single sequence sorting i.e.sorting the objects based on single data member where as comparator interface is used to sort the object based on multiple data members. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   java.util   comparable   comparator   collections Asked in 23 Companies basic   frequent | ||||
| ||||
Ans. Collections are re-sizable in nature. We can increase or decrease the size as per recruitment. Collections can hold both homogeneous and heterogeneous data's. Every collection follows some standard data structures. Collection provides many useful built in methods for traversing,sorting and search. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   collections classes   advantages of collections over arrays   collections vs arrays   basic interview question Asked in 6 Companies basic   frequent | ||||
| ||||
Ans. Float can represent up to 7 digits accurately after decimal point, where as double can represent up to 15 digits accurately after decimal point. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   data types   float   double   difference between   basic interview question | ||||
| ||||
Ans. Combine the data of our application and its manipulation at one place. Encapsulation Allow the state of an object to be accessed and modified through behaviors. Reduce the coupling of modules and increase the cohesion inside them. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   oops concepts   encapsulation  object oriented programming (oops)  oops concepts   basic interview question Asked in 2 Companies basic   frequent | ||||
| ||||
Ans. private static boolean isPalindrome(String str) { if (str == null) return false; StringBuilder strBuilder = new StringBuilder(str); strBuilder.reverse(); return strBuilder.toString().equals(str); } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   string   stringbuilder   stringbuilder   string class   code   palindrome Asked in 38 Companies Basic   frequent | ||||
| ||||
Ans. public void checkIfAnagram(String str1,String str2){ boolean anagram = true; for(char c:str1.toCharArray()){ if(!str2.contains(String.valueOf(c))){ System.out.println("Strings are Anagrams"); anagram = false; } if(anagram == true){ System.out.println("Strings are not Anagrams"); } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   check if 2 strings are Anagrams Asked in 30 Companies basic   frequent | ||||
| ||||
Ans. LinkedList and ArrayList are two different implementations of the List interface. LinkedList implements it with a doubly-linked list. ArrayList implements it with a dynamically resizing array. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   list   arraylist   linkedlist   difference between basic   frequent | ||||