Home » Java » Core Java » Page 60

Core Java

JShell in Five Minutes

This post builds on my My Top Java 9 Features post by looking more in depth at these features. Here we show you how you can learn jshell in five minutes, and improve your Java 9 development experience. Getting Started Assuming you have downloaded, and installed Java 9 then you can start the shell by typing – jshell Or if ...

Read More »

Java Command-Line Interfaces (Part 18): JCLAP

Giles Winstanley‘s JCLAP (Java Command-Line Argument Parser) is the eighteenth library covered in this series of posts on Java-based command line processing libraries. This post’s examples are based on JCLAP 1.4, which requires Java 8. The main JCLAP page states, “JCLAP helps Java developers to create simple-to-use command-line interfaces for their applications.” The “definition” stage is accomplished with JCLAP via ...

Read More »

Introduction to Java Virtual Machine (JVM)

What is JVM A Java virtual machine (JVM) is an abstract computing machine that enables a computer to run a Java program. There are three notions of the JVM: 1. Specification 2. Implementation 3. Instance. The specification is a document that formally describes what is required of a JVM implementation. Having a single specification ensures all implementations are inter-operable. A JVM ...

Read More »

Java Command-Line Interfaces (Part 17): jw-options

The JavaWorld article Processing command line arguments in Java: Case closed by Dr. Matthias Laux introduces a simple Java-based library for processing command-line arguments that I’ll refer to in this post as jw-options. The referenced article provides background information on why certain design decisions were made in construction of the Options class. The “Conclusion” of the article describes the advantage ...

Read More »

Java Command-Line Interfaces (Part 16): JArgp

The Java-based command line argument processing library covered in this post was the featured library of an IBM developerWorks article Java programming dynamics, Part 3, Applied reflection (this 2003 article was “archived” in 2016, but is still available for PDF download). The library, called JArgp (Java Command Line Argument Processing Library), is defined on its main web page as “a ...

Read More »

How to Format a String, Clarified!

A User-Friendly Introduction The Java Documentation of String formatting is not the easiest to read and understand if you are not familiar with String formatting or just want a quick solution. Although it is complete, it is not very user-friendly, so I thought I would try and write a clearer version. This article is as much for you as it ...

Read More »

Enum: How to use name() and toString() methods correctly

The Difference Between Two Methods? The Java Enum has two methods that retrieve that value of an enum constant, name() and .toString(). The toString() method calls the name() method which returns the string representation of the enum constant. In listing 1, the value returned by calling the name() and toString() on an Animal.DOG constant method is DOG. Listing 1: Animal Enum public ...

Read More »

Testing time based reactor core streams with Virtual time

Reactor Core implements the Reactive Streams specification and deals with handling a (potentially unlimited) stream of data. If it interests you, do check out the excellent documentation it offers. Here I am assuming some basic familiarity with the Reactor Core libraries Flux and Mono types and will cover Reactor Core provides an abstraction to time itself to enable testing of functions which depend on ...

Read More »

Java 9, Jigsaw, JPMS, and Modules: A Personal Exploration

Java 9 delayed so many times because of Project Jigsaw, and you may be heard a lot of thing about modules, modularity, and other stuff, so, what it’s all about? What the heck is modularization and what do we mean by modularized platform? Java Platform Module System (JPMS)? Is it going to be a revolution in Java ecosystem? This post is my ...

Read More »