In this example, we will show the range of functionality provided by the java.util.Scanner – Scanner Java class. We will also see how to use the Java Scanner class to read a Java input form the console. A simple text scanner which can parse primitive types and strings using regular expressions. You can also check this tutorial in the following video:
In this post, we are going to show you how to configure your application to use slf4j and logback as logger solution. 1. What is logback?Logback is intended as a successor to the popular log4j project. It was designed by Ceki Gülcü, log4j’s founder. It builds upon a decade of experience gained in designing industrial-strength logging systems. The resulting product, i.e. logback, is faster and has
This article introduces the FileLock class and its basic usage. This article examples show using file locks with FileChannels. The examples in this article are compiled and run in Windows OS environment. Note that Java SE 7 is required to run the code. 1. IntroductionFileLock is a token representing a lock on a region of a file. This is an abstract class defined in the java.nio.channels package. 1
In this article, we are going to show how to use the new Java 8 Optional – java.util.Optional class. 1. IntroductionThe null reference is a very common problem in Java, everybody got once a NullPointerException because some variable or input parameter was not properly validated. In Java, null, can have a logical value and a meaning; so it is important to take it into consideration and do not ignor
In this tutorial, we will learn to use the HTML Editor available through the Web Tools Platform (WTP) within Eclipse. HTML stands for Hyper Text Markup Language, and is composed of a set of markup tags that form / describe a specific document content containing HTML tags and text. A web browser can read such HTML documents and compose them into visible or audible web pages. The browser does not di
In this article we are going to explain how to use and take advantage of the possibility to implement default methods in interfaces. This is one of the most important features that are available since Java update 8. All examples have been implemented using Eclipse Luna version 4.4 and Java version 8 update 5. Reasons for default methods in interfaces In “old” Java, if we want to add new methods to
This is an example of how to write an image to a file, making use of the ImageIO utility class of Java. ImageIO class of javax.imageio package, provides methods to locate ImageReaders and ImageWriters, to perform encoding and decoding and other methods for image processing. Among the methods of ImageIO class, there are the write(RenderedImage im, String formatName, File output), write(RenderedImag
In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology, (part of Java Enterprise Edition – JEE), provides a simplified way for rapid development of web-based applications that are server- and platform-independent. It helps Java developers to create dynamically generated web pages based on HTML, XML, or o
Chandan SinghNovember 20th, 2014Last Updated: November 20th, 2014 In this example, we shall be demonstrating the use of java.util.concurrent.ForkJoinPool Class. This class was introduced in Java 7. The java.util.concurrent.ForkJoinPool Class implements java.util.concurrent.Executor and java.util.concurrent.ExecutorService interfaces. This class works on divide-and-conquer policy. Each major subtas
Anirudh BhatnagarNovember 21st, 2014Last Updated: November 21st, 2014 In this example we will see how and when to use java.util.TreeSet. A TreeSet is a set implementation which provides total ordering on its elements. The elements are ordered using their natural ordering, or by a Comparator typically provided at sorted set creation time. A TreeSet is typically used when we want to keep the element
Dani BuizaNovember 20th, 2014Last Updated: February 25th, 2019 The way java.util.HashMap entries are indexed and stored has changed in the Java 8 update. Hash elements use balanced trees instead of linked lists under certain circumstances now. All these is what this article is about. The main idea is that when the number of items in a hash is larger than a certain value, the hash will change from
In this post, we feature a comprehensive Java Map Example. We will discuss about Maps in Java. A Map is an interface that maps keys to values. The keys are unique and thus, no duplicate keys are allowed. A map can provide three views, which allow the contents of the map to be viewed as a set of keys, collection of values, or set of key-value mappings. In addition, the order of the map is defined a
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く