Skip to main content

Posts

Showing posts with the label java

How To manually Install Oracle Java 12 on Debian 9

Java and the JVM (Java's virtual machine) are required for many kinds of software, including Tomcat , Jetty , Glassfish , Cassandra , Jenkins , Gradle , ELK Stack , Graylog and  Eclipse IDE Java Development Kit (JDK) is a package of tools for developing Java-based software, whereas the JRE is a package of tools for running Java code.The JRE can be used as a standalone component to simply run Java programs, but it's also part of the JDK. The JDK requires a JRE because running Java programs is part of developing them. This post is designed to guide you through the manually installation process, of the Java Developer Kit (JDK) using binary formats. While this post will focus on  version 12.0.1  You can still select the version you wish to use for your projects and still be able to use the procedure's detailed here as long as the version that you chose is in binary format. When you finish, you'll be able to use the JDK to develop software or use the Java Runtime t...

Difference between HashMap, LinkedHashMap and TreeMap

 LinkedHashMap is an implementation of java.util.Map interface with predictable iteration order (the order of insertion) i.e. LinkedHashMap will iterate in the order in which the entries were put into the map. LinkedHashMap implementation differs from HashMap in the way that it maintains a doubly-linked list running through all of its entries. This linked list defines the iteration ordering, which is normally the order in which keys were inserted into the map. The insertion order is not affected if a key is re-inserted into the map. Performance of LinkedHashMap is slightly below than that of HashMap, due to the added expense of maintaining the linked list. The other two important implementations of Map interface are java.util.HashMap and java.util.TreeMap. They offer mostly the same functionality. The most important difference is the order in which iteration through the entries will happen. HashMap makes no guarantee about the order. The order can even change completely whe...

Implement singly linked list in java

One disadvantage of using arrays to store data is that arrays are static structures and therefore cannot be easily extended or reduced to fit the data set. Arrays are also expensive to maintain new insertions and deletions. In this article we take a look at another data structure called Linked Lists that addresses some of the limitations of arrays. We will see how to implement singly linked list in java, you can also watch the following video for better understanding of data structure A linked list is a linear data structure where each element is a separate object. It is one of the most used data structure. In singly linked list, Node has data and pointer to next node. It does not have pointer to the previous node. Last node ‘s next points to null, so you can iterate over linked list by using this condition. Node for linked list can be presented as below: // A simple Java program to introduced single linked list public class LinkedListexercise2 { N...

Java data structures

A data structure is a particular way of organizing data in a computer so that it can be used effectively. The idea is to reduce the space and time complexities of different tasks. This video is designed  to help you get started with java data structures some popular linear data structures that  are explained includes  Array, Array List,  Linked List, Stack and Queue.