Count Number of Words in a String - Java Program
Write a Java program to count the number of words in a String is asked quite frequently in Java interviews. To test the logical thinking of the candidates it is often asked to write this program...
View ArticleHow to Reverse a String in Java
Writing a Java program to reverse a string using a recursive method or using iteration is one Java interview coding question asked quite frequently along with some other popular questions like How to...
View ArticleApache Avro Format in Hadoop
Apache Avro file format created by Doug cutting is a data serialization system for Hadoop. Avro provides simple integration with dynamic languages. Avro implementations for C, C++, C#, Java, PHP,...
View ArticleYARN in Hadoop
YARN (Yet Another Resource Negotiator) is the cluster resource management and job scheduling layer of Hadoop. YARN is introduced in Hadoop 2.x version to address the scalability issues in MRv1. It also...
View ArticleList in Python With Examples
List in Python is one of the sequence data type that can store a group of elements. Some of the important points about Python list are- A list can store elements of different types.List maintains the...
View ArticleConcatenating Lists in Python
In this post we’ll see how to concatenate or join two lists in Python.1. The best way to join two lists in Python is to use ‘+’ operator.num_list1 = [1,2,3,4]num_list2 = [5,6,7]#concatenating lists...
View ArticleListIterator in Java
In this post we'll see another way to iterate a List using ListIterator in Java.Though there is already an iterator provided for the list, which will iterate sequentially through all the elements in a...
View ArticleDifference Between HashMap And ConcurrentHashMap in Java
In this post we'll see the differences between ConcurrentHashMap and HashMap in Java which is also a good Java interview question.ConcurrentHashMap was added in Java 5 as an alternative to HashTable to...
View ArticleDifference Between HashMap And Hashtable in Java
Though both Hashtable and HashMap in Java have some similarities like storing elements as a (key, value) pair and using hashing technique to store elements. From Java V1.2, Hashtable class was also...
View ArticleHashMap Vs LinkedHashMap Vs TreeMap in Java
Though HashMap, LinkedHashMap and TreeMap all are implementations of the Map interface and share some traits like storing (key, value) pair, having a fail-fast iterator, not being synchronized but...
View ArticleHow to Loop Through a Map in Java
To loop or iterate any Map implementation like HashMap or Treemap in Java, you need to know about three methods declared by Map interface that play a role in iterating a Map.Set<Map.Entry<K,...
View ArticleWhy no Multiple Inheritance in Java
Inheritance is one of the four fundamental OOP concepts. It can be defined as a mechanism, by which one class acquires, all the properties and behaviors of another class. Java being an object oriented...
View ArticleDifference Between throw And throws in Java
In this post we'll see the difference between throw and throws keyword in Java which are used in Java exception handling. These two keywords, though look similar, are functionality wise very different...
View ArticleDifference Between equals() Method And equality Operator == in Java
Difference between equals() method and equality operator “==” in Java is a frequently asked interview question. At the same time it may be a bit confusing for the first-time Java programmer to get the...
View ArticleGeneric Class, Interface And Generic Method in Java
In the post generics in Java basics of Java generics are already covered. In this post we’ll see how to create generic class, generic method and generic interface in Java. Generic class in JavaA...
View ArticleHow to Create Your Own BlockingQueue - Java Program
This post shows how you can create your own BlockingQueue in Java using ReentrantLock and Condition interface. Condition interface provides method await and signal which work the same way as wait and...
View Articlefinal Vs finally Vs finalize in Java
What are the differences among final, finally and finalize in java is one question asked a lot in Java interviews. This question is asked more to confuse a candidate as they all sound similar and of...
View ArticleStringBuffer Class in Java
StringBuffer class in Java is the companion class of Java String class. StringBuffer in Java is a mutable (modifiable) sequence of characters which is in contrast to String class which is an immutable...
View ArticleLinkedTransferQueue in Java
LinkedTransferQueue is added in Java 7 and it is an implementation of TransferQueue interface. TransferQueue interface in JavaIt will be worthwhile to spend some time knowing the TransferQueue...
View ArticleDifference Between Checked And Unchecked Exceptions in Java
Before going into the differences between checked and unchecked exceptions in Java let's first see what these two types of exceptions are.Table of contentsChecked Exception in JavaChecked exception...
View Article