In this article, we will learn to print the different Alphabet Pattern Programs in Java. This is one among the popular Java interview questions for fresher. Let's look into the below possible Alphabet / Character Pattern Programs in Java. … [Read more...]
8 Best ways to Iterate through HashMap in Java
As a Java developer, everyone should know how to Iterate through HashMap, as it will be part of his routine programming. Unlike other Collections, we cannot iterate through HashMap directly we need to get the keySet or entrySet to iterate. In this article, we will learn about all the different ways of iterating a HashMap in Java. … [Read more...]
Java 8 – Lambda Expressions with Examples
Lambda expressions are introduced in Java 8 and is one of the most important feature of Java 8. A Lambda expression is a block of code with can be passed around and executed which is not possible in the previous versions of Java, other programming languages such as LISP, Python, Ruby, Scala etc.. has this feature. With the introduction of Lambda expressions Java paved way … [Read more...]
5 Ways to convert Java char array to string
In this article, we will look into the possible ways to convert Java char array to string. Passing the char array to the String class constructor Using the valueOf() method of String class Using the copyValueOf() method of String class Using append() method of StringBuilder class Manual way … [Read more...]
Top 8 Java Interview Questions On main() Method
Execution of a Java application starts with the main() method, this is one of an important Java interview questions for both freshers and experienced. In this article, we will discuss some of the possible java interview questions on main() method. … [Read more...]
58 Number Pattern Programs In Java | Pyramid and Diamond Pattern Programs
In this article, we will learn to print the different Number pattern programs in Java. This is one of the important Java interview questions for fresher. Let's look into the below possible number pattern programs … [Read more...]
How to convert XML to JSON in Java – Jackson 2 XmlMapper
Jackson is one of the popular JSON Parser for Java application, with the release of Jackson 2 they have added the support of XML Parsing. In this article, we will learn how to convert XML to JSON using Jackson 2 library. … [Read more...]
Java Program to Print Floyd’s Triangle with Example
Floyd's triangle is a right-angled triangle of natural numbers, which is named after Robert Floyd. It is defined by filling the rows of the triangle with consecutive numbers, starting with a 1 in the top left corner, there are n integers in the nth row and a sum of (n(n+1))/2 integers in n rows. Write a java program to print Floyd's triangle is one of the popular java interview … [Read more...]
How to count the occurrences of an element in array – Java?
Write a program to count the occurrences of an element in an array is one of the basic question which will be asked in a Java Interview. After the introduction of Collection framework performing this operation is a pretty easy task. Let see how we can count the occurrence using HashMap. … [Read more...]
Difference between Integer.parseInt() vs Integer.valueOf() in Java
Both the Integer.parseInt() and Integer.valueOf() method is used to convert a String into Integer in Java, both does the same work then why there is a need for two different method will be the question here. They both does the same job but has a slight difference among them. Lets look into the difference between parseInt vs valueOf in Java … [Read more...]
Tower of Hanoi in Java Using Recursion
What is Tower of Hanoi ? Tower of Hanoi is also called as Tower of Brahma or Lucas Tower. It is one of the most popular problem which makes you understand the power of recursion. Tower of Hanoi is a mathematical puzzle which consist of 3 poles and number of discs of different sizes. Initially all the discs will be places in the single pole with the largest disc at the bottom … [Read more...]
Why Java does not supports Multiple Inheritance – Diamond Problem?
Multiple Inheritance is nothing but one class extending more than one class. In Java Multiple Inheritance is not supported due to the reason it will be quiet complex to manage the dependencies. Lets look into the most famous problem called "Diamond Problem" which occurs if Java supported Multiple Inheritance. … [Read more...]