迹忆客 EN >

所有文章

Java Change Date Format

发布时间:2025/04/14 作者:JIYIK 分类:Java

There are various options available for converting date string to date format. The methods mentioned below can bring the desired result. Let us understand the various ways from the following code block. import java.text.ParseException ; imp...

查看全文

Calendar date in YYYY-MM-DD format in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

Java Date encapsulates the current time and date. The Date class does this with the help of two constructors - Date() and Date(long millisec) constructor. We use Date() the constructor to initialize the object with the current time and date...

查看全文

Implementing a min-max heap in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

In this article, we will implement a max heap and a min heap using PriorityQueue the class. We will also demonstrate inserting and removing elements from the heap. Introduction to Min-Max Heap in Java Heap is a tree-based data structure, wh...

查看全文

Implementing a Min Heap in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

A min heap is a heap in which every internal node is less than or equal to the value of its child nodes. We will see in the following points how to implement a min heap with and without using a library. Minimal heap implementation in Java w...

查看全文

Increasing the heap space in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

In Java, the heap space is mainly used for garbage collection and allocating memory for objects. A default heap space is allocated when JVM is installed on our machine, but it may be different. The following points show how we can increase...

查看全文

Detecting EOF in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

In this tutorial, we will see how to while detect EOF( End OF File ) in Java using a loop. We will also discuss developing a program that continues reading content until it reaches the end of a file. From a programming perspective, EOF is a...

查看全文

Get resource URL and content in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

getResource() This tutorial will demonstrate how to use the function to get the resource URL and read the resource file in Java . getResource() Use the function to get the resource URL in Java We will use the method in Java getResource() to...

查看全文

Getting the host name in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

In this tutorial, we will see how to get the IP address and host name using Java API. InetAddress Get the host name in Java using The package java.net contains classes for handling the IP address and host name of the current machine InetAdd...

查看全文

Get the IP address of the current device in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

An Internet Protocol (IP) address is an identifier for each device connected to a TCP/IP network. This identifier is used to identify and locate nodes in the middle of communication. The IP address format, such as 127.0.0.0, is a human-read...

查看全文

Generate a random double value between 0 and 1 in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

This article will introduce three methods to generate double random values ​​between 0 and 1 of primitive types. To demonstrate the randomness of the generated values, we will use a loop to generate ten random double values ​​betwee...

查看全文

Setting the seed of a random generator in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

A seed is a number or vector assigned to a pseudo-random generator to generate the desired sequence of random values. If we pass the same seed, it will generate the same sequence. We usually assign the seed as the system time. In this way,...

查看全文

Switching on enumeration types in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

This article explains how to use enum in Java . We will use statement switch with enum in two ways . switch In Java, we use traditional switch and case to perform enumeration operations. switch In this example, we SwitchEnum create an enume...

查看全文

How to delay for a few seconds in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

This tutorial explains how to create program delays in Java and gives some sample code to understand it. There are several ways to create a time delay, such as TimeUnit.sleep() ,, ScheduleAtFixedRate() etc. Thread.sleep() Let's look at an e...

查看全文

How to Convert Hashmap to JSON Object in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

This article explains how to convert a Hashmap to a JSON object in Java. We will see a detailed example of creating a hashmap and then converting it to a JSON object. Hashmap and JSON are both very commonly used by developers as they help u...

查看全文

How to sort a Map by value in Java

发布时间:2025/04/14 作者:JIYIK 分类:Java

This tutorial explains how to Mapkey, value sort pairs by value in Java and lists some sample codes to understand it. There are several ways to Map sort . Here we use sort() the , sorted() method, and Comparator interface. Let's look at an...

查看全文

扫一扫阅读全部技术教程

社交账号
  • https://www.github.com/onmpw
  • qq:1244347461

热门文章

热门标签

扫码一下
查看教程更方便