Uncategorized

Reader read() method in Java with Examples

The ‘read()’ method is used to read a single character from an input stream. This method belongs to classes that implement the ‘Reader’ abstract class or its subclasses. read() method in java The ‘read()’ method in java reads a single character from an input stream, returning its Unicode value as an integer. If the end of the …

Reader read() method in Java with Examples Read More »

Detect number of pages in a PDF file using Java

Detect number of pages in a PDF file using Java To detect the number of pages in a PDF file using Java, we’ll use Apache PDFBox. You can get PDFBox from Maven Central. Maven Dependency for PDFBox <dependency> <groupId>org.apache.pdfbox</groupId> <artifactId>pdfbox</artifactId> <version>2.0.24</version> </dependency> Java Code to Get Number of Pages using PDFBox. import org.apache.pdfbox.pdmodel.PDDocument; import java.io.File; …

Detect number of pages in a PDF file using Java Read More »

Understanding Java Writer Class

In  this  tutorial ,  We  will learn  about  writer Class  in  java. Writer  is an abstract  class  that  defines  streaming  character  output. All  of the methods in this  class return  a void value  and  throw  an  IOException  in the  case  of errors. The ‘Writer’ class  provides  a common set  of methods for writing  character  data …

Understanding Java Writer Class Read More »

Show Notification in Windows using Java

To show a notification in Windows using Java, you can utilize the SystemTray and TrayIcon classes available in the java.awt package. To show notifications in windows : SystemTray and TrayIcon Approach: Check if the system tray is supported (SystemTray.isSupported()). Create a TrayIcon object with an image and tooltip. Add the TrayIcon to the system tray (SystemTray.add()). Use …

Show Notification in Windows using Java Read More »

How to flatten a stream using flatMap() method in Java

Hey, Coders! In this tutorial, we are going to learn about flatten a stream using the flatMap() method in Java. map(): It transforms each stream element into a single element of a new stream. flatMap(): It transforms each stream element into a stream of multiple elements. Flattening: It is the process of converting two or …

How to flatten a stream using flatMap() method in Java Read More »

Java Object Class

In this article, we’ll have a comprehensive look at the Java object class, a fundamental component of Java programming. Object class is the root of the class hierarchy. we’ll learn with examples for better understanding. So let’s get started   Introduction In Java, object class is at the top of the class hierarchy. Every class in Java is considered as …

Java Object Class Read More »

Scroll to Top