Home » Tag Archives: Java

Tag Archives: Java

Java 8 Functional Interfaces Introduction Example

Hello readers! In this tutorial, we will learn the amazing feature of Java 8 Functional Interfaces. 1. Introduction To achieve the benefits of functional programming in Java, JDK developers introduced Functional Interfaces/Single Abstract Method (SAM) Interfaces in Java 8 programming. A functional interface is an interface that has only one abstract method A functional interface can have multiple default and ...

Read More »

Java 8 Lambda Expressions Introduction Example

Hello readers! In this tutorial, we feature a comprehensive article on Java 8 Lambda Expressions.  1. Introduction To achieve the benefits of functional programming in Java, JDK developers introduced Lambda Expressions in Java 8 programming. A lambda expression is a nameless function which does not have the name, return type, and access modifiers A lambda expression instance can be assigned ...

Read More »

Java Date Format Example

In this article, we will check the options available on Java Date Format. 1. Introduction Java has multiple packages providing various utility functions to make developer job easier. One such is the java.text package which includes utility classes for parsing and formatting numbers and dates, along with utility classes for building other kinds of parsers. The java.text.DateFormatclass and its concrete ...

Read More »

Java Classes and Objects Tutorial

Java language has object-oriented features to create classes and objects. In this tutorial, how to develop Java classes and instantiate objects from java classes is discussed in detail. Table Of Contents 1. Overview 2. Java Classes and Objects Tutorial 2.1. Prerequisites 2.2. Download 2.3. Setup 2.4. Java Classes and Objects 2.5. BestPractices 2.6. Error Handling 2.7. Code Conventions 3. Download ...

Read More »

Java Immutable Objects Example

1. Introduction In programming, an object is considered immutable if its state cannot change after it is created. Java not only supports immutable objects but as a best practice, they should be widely used. In this post, we will take a look at how to create immutable objects, their use cases and some examples of immutable Classes. The technologies that ...

Read More »

How to Create and Run Your First Java Program

1. Introduction This is an in-depth article on how to create and run your first java program. Java compiler is used to compile java code. Java class is the output of the compilation. To execute the program you need java runtime virtual machine. 2. Run Your First Java Program 2.1 Prerequisites Java 7 or 8 is required on the linux, ...

Read More »

Java HashMap vs TreeMap Example

1. Introduction A very important data structure in programming is the Map which is used for extremely fast lookups. In this post, we will take a look at two implementations of the Map data structure in Java, the HashMap and TreeMap classes. The main difference between those two implementations is that the HashMap offers better lookup and insertion times but ...

Read More »

Java ArrayList vs LinkedList Example

1. Introduction One of the most commonly used data structures in programming is the Array. Java comes with two implementations of the Array data structure, the ArrayList and LinkedList classes. In a nutshell, the ArrayList is a resizable-array implementation, whereas the LinkedList is a doubly-linked list implementation. In this post, we will cover the differences between the methods and time ...

Read More »

Java public static void main(String[] args) Example

1. Introduction In every programming language, when a program starts the execution it has to start from somewhere. For Java, the entry point for a program is the main method. In this post, we will examine this very important method and learn how to use it to start simple programs. The technologies that we will use in the code examples ...

Read More »