Big O Notation

I want to explain it in a few simple words. Basically this is a tool to express how efficient your algorithm is. One point we need to remember that, the efficiency of an algorithm is very much relative, because it depends on many other factors like number of programs or process is currently running, the…

Problems and Solutions on Java Lambda Expressions

Q1. Print one simple text using the Lambda Expression (One Argument is passed inside the argument list). Ans:- Q2. Print one simple text using the Lambda Expression (No Argument is passed inside the argument list). Ans:- Q3: Example of multiline expression inside the Lambda Body :- write one functional interface with a method having string…

What is the Difference between groupId and artifactId in Maven

The main difference between the groupId and artifactId is groupId specifies the ID of the project group while the artifactId specifies the id of the project. So group Id is always used to identify the project group and artifactId is used to identify the specific project that is developed by that particular group of organization….

JavascirptExecutor in Selenium

JavascirptExecutor is an Interface. Located inside the package org.openqa.selenium. It has two methods. One is executeScript another one is executeAsyncScript . Method executeScript:- Object executeScript(String script, Object… args); So this is how the method is defined in the source code. This method is abstract and public in nature as it is mentioned inside the Interface,…

Queue Data Structure for Beginners

Queue is a kind of data structure where the order of the element matters. It’s like a line in-front of movie ticket line. The person who came last in the queue will stand at the rear position of the line. And the person who joined the line at the very first would be the person…

Autoboxing and Unboxing: Primitive data types storing in Array Lists

As we are aware that the ArrayLists in Java stores the pointers to objects. Then how can I store the primitive datatypes inside the ArrayLists. Because when storing the int type in ArrayLists it’s showing the below mentioned error in IDE. Same thing will happen for data type double also as shown below:- So, here…

Is the method Overriding and Polymorphism are same in Java?

Polymorphism is one of the characteristics of object oriented programming. Poly means many and Morph means :- Overriding of a method is nothing but smooth modification of a method that is inherited from super class by it’s subclass. So it’s like smooth change or modification of the method of the superclass. So, from this above…

Composition in java with examples

In one sentence composition in java is used to fulfill the HAS-A relationship. Just imagine one scenario. In the above picture John is flying his own helicopter. So John has a Red two seater helicopter and also John has two hands. So if I consider John as a class, then two instance variables are like…

Array: Binary Search and the Ordered Array

Now imagine an Array where the numbers are stored in an orderly manner. Means minimum index stores the lowest number and the maximum index number (Here the number is 6) stores the highest number but in the orderly manner. Please take a look for a sample ordered Array as shown below:- Here in the above…

Java composition with example

In one word, composition is nothing but a ‘Has-A’ relationship. As we know, in object oriented programming there are two popular relationship present, one is ‘Is A’ and another one is ‘Has A’ relationship. The main benefit of has a relationship is that this can reference many classes. Let us check an example of Television….