JIYIK CN >

Current Location:Home > Learning > PROGRAM >

All

Setting the seed of a random generator in Java

Publish Date:2025/04/14 Author:JIYIK Category: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,...

Full

Generate a random double value between 0 and 1 in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Get the IP address of the current device in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Getting the host name in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Detecting EOF in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Increasing the heap space in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Implementing a Min Heap in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Implementing a min-max heap in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Calendar date in YYYY-MM-DD format in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

How to clear the console in Java

Publish Date:2025/04/14 Author:JIYIK Category:Java

In this tutorial, we will look at two ways to clear the console screen in Java. We will learn how to execute Java clear screen commands at runtime through examples. Clearing the console using ANSI escape codes in Java We can use special cod...

Full

Class fields and instance fields in Java

Publish Date:2025/04/14 Author:JIYIK Category:Java

In this article, you will learn the basic terminology of Java programming language such as local variables, input parameters, class fields, and instance fields in Java. Local variables in Java Variables whose scope is bound to a block, meth...

Full

Mutex Locks in Java

Publish Date:2025/04/14 Author:JIYIK Category:Java

In the field of computer science, mutual exclusion or mutex is known as the property of concurrency control. Every computer uses a minimum sequence of program instructions called a thread. At a time, the computer works on one thread. For be...

Full

Difference between size and length in Java

Publish Date:2025/04/14 Author:JIYIK Category:Java

This tutorial explains the difference between size and length in Java. We have also listed some sample codes to help you understand the topic. Java has a size() method and a length property. Beginners may think that they are interchangeable...

Full

Get user home directory in Java

Publish Date:2025/04/14 Author:JIYIK Category:Java

This tutorial explains how to get the user's home directory in Java and lists some sample code to guide you through the topic. For a multi-user operating system, each user has a file system directory; this directory is called the user's hom...

Full

Switching on enumeration types in Java

Publish Date:2025/04/14 Author:JIYIK Category: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...

Full

Scan to Read All Tech Tutorials

Social Media
  • https://www.github.com/onmpw
  • qq:1244347461

Hottest

Tags

Scan the Code
Easier Access Tutorial