Category: Java

java tutorials

How to Calculate Folder Size in Java

Calculating the size of a folder or directory is trivial. In Java you can recursively traverse each folder and calculate the size of each file individually, and return the sum of all the files....
java tutorials

Converting a String into a LocalDate – Java 8

This tutorial shows how to convert a java.lang.String into a java.time.LocalDate. We can convert a String into a Date using the parse() method of the LocalDate and DateTimeFormatter classes. // from java.lang.String into java.time.LocalDate...
java tutorials

Converting a String into a Date in Java

This tutorial shows how to convert a java.lang.String into a java.util.Date. We can convert a String into a Date using the parse() method of the DateFormat and SimpleDateFormat classes. // from java.lang.String into java.util.Date...
java tutorials

Getting Current Date and Time in Java

This tutorial shows how to get the current date and time in Java. The standard Java classes we can use are java.util.Date, java.util.Calendar and the new java 8 java.time.LocalDateTime and java.time.ZonedDateTime. You could also...
tomcat tutorials

Monitor Tomcat with JMX and jConsole

This tutorial shows how to monitor Tomcat with JMX via jConsole. Monitoring is a key aspect for developers or system administrators. Looking inside a running server, obtaining some statistics like: Heap / Non-heap memory...
java tutorials

Take a Screenshot in Java and save as PNG/JPG

A screenshot, screen capture, screen cap, screen dump, or screengrab is a visual snapshot in time of the monitor, television, or other visual output device in use. In the following tutorial, we demonstrate how...
simple java qr code generator example

Simple Java QR Code Generator Example

Quick Response Codes (QR Codes) are becoming one of the most popular barcode systems in the world, thanks to smartphones. Their usage is really versatile, from automotive, product packaging to online ticket services. Business...