Vivek Verma has Published 113 Articles

How to print a formatted text using printf() method in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 19:07:30

589 Views

In Java, formatted text refers to those text that has been processed and arranged according to a specific format. According to the article, we will use the printf() method to learn how to print the formatted text. Formatted Text using printf() Method In Java, to print the formatted output or ... Read More

How can we read from standard input in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 19:05:27

37K+ Views

The standard input (stdin) can be represented by System.in in Java. The System.in is an instance of the InputStream class. It means that all its methods work on bytes, not Strings. To read any data from a keyboard, we can use either the Reader class or the Scanner class. Using Reader ... Read More

How can we convert a hexadecimal value to a byte in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 19:03:15

289 Views

This article will discuss how to convert a hexadecimal value to a byte value in Java. Before converting it to a byte, let's first understand what hexadecimal and byte values are. Hexadecimal Value In Java, a hexadecimal number is a base-16 number represented using the digits 0-9 and the letters ... Read More

How to find the number of days in a month of a particular year in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 18:58:51

2K+ Views

The given task is to find the number of days in a month of a particular year. To understand this, consider that if we can determine the maximum day value in a month, we can use that as the number of days in that month. To ... Read More

How To Check Whether a Number Is a Fascinating Number or Not in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 18:48:33

5K+ Views

What is Fascinating Numbers? A Fascinating number is a number if the result of concatenation of the (original) number with its multiples of 2 and 3 contains all the digits from 1 to 9. For example, we have the number 192. Its product with 2 is 384, and with 3 ... Read More

How To Check Whether a Number is a Evil Number or Not in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 18:24:59

4K+ Views

What is Evil Number? In mathematical terms, an Evil number is a number whose binary representation has exactly an even number of 1's present in it. For example, the binary representation of 3 is 0011. So the number 1's is even the number 3 is an evil number. A binary ... Read More

How To Check Whether a Number Is a Bouncy Number or Not in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 18:17:10

3K+ Views

What is Bouncy Number? In mathematical terms, a Bouncy number is a positive integer whose digits are neither in increasing nor in decreasing order. For example: 101, 102, 103, 104, 105, 106, 107, 108, 109, and 120 are the bouncy numbers, which digits does not follow any specific order. The bouncy ... Read More

Can Enum implements an interface in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 17:58:20

13K+ Views

Yes, an Enum implements an Interface in Java. It can be useful when we need to implement business logic that is tightly coupled with a specific property of a given object or class. Before implementing the interface with an enum, let's discuss enums and interfaces in Java with a code ... Read More

When can we call wait() and wait(long) methods of a Thread in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 17:52:43

626 Views

This article will discuss the wait() and wait(long timeout) methods, along with a suitable example that explains when to call these methods in a thread in Java. The wait() Method In Java, the wait() method is used in multithreading and causes the current thread to "wait" until another thread calls ... Read More

Importance of deepToString() and asList() methods in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 17:38:52

381 Views

In Java, both deepToString() and asList() methods are static methods of the Arrays class. An array is an object that holds a fixed number of values of a similar type in a contiguous memory location. The deepToString() Method In Java, the deepToString() method is used to convert a multi-dimensional array ... Read More

Previous 1 ... 4 5 6 7 8 ... 12 Next
Advertisements