Java

Java File separator, separatorChar, pathSeparator, pathSeparatorChar — step-by-step Programming tutorial on Progressive Robot

Java File separator, separatorChar, pathSeparator, pathSeparatorChar

URL: https://www.progressiverobot.com/java-file-separator-separatorchar-pathseparator-pathseparatorchar/ java.io.File class contains four static separator variables. Here we will learn about them and when to use it. File.separator: Platform dependent default name-separator character as String. For windows, it's '\' and for unix it's '/'. File.separatorChar: Same as separator but it's char. File.pathSeparator: Platform dependent variable for path-separator. For example PATH or CLASSPATH […]

Read more
Java QR Code Generator - zxing example — step-by-step Programming tutorial on Progressive Robot

Java QR Code Generator – zxing example

URL: https://www.progressiverobot.com/java-qr-code-generator-zxing-example/ Today we will look into the Java QR code generator program. If you are tech and gadget savvy, then you must be aware of the QR code. You will find it everywhere these days – in blogs, websites, and even in some public places. This is very popular in mobile apps, where you […]

Read more
Java Singleton Design Pattern Best Practices with Examples — step-by-step Programming tutorial on Progressive Robot

Java Singleton Design Pattern Best Practices with Examples

URL: https://www.progressiverobot.com/java-singleton-design-pattern-best-practices-examples/ Introduction _Java Singleton Pattern_ is one of the _Gangs of Four Design patterns_ and comes in the _Creational Design Pattern_ category. From the definition, it seems to be a straightforward design pattern, but when it comes to implementation, it comes with a lot of concerns. In this article, we will learn about singleton […]

Read more
Java Thread Dump - VisualVM, jstack, kill -3, jcmd — step-by-step Programming tutorial on Progressive Robot

Java Thread Dump – VisualVM, jstack, kill -3, jcmd

URL: https://www.progressiverobot.com/java-thread-dump-visualvm-jstack-kill-3-jcmd/ Java Thread dump is list of all the threads active in the JVM. Java Thread Dump Java thread dump is very helpful in analyzing bottlenecks in the application and [deadlock](/community/tutorials/deadlock-in-java-example "Java Deadlock") situations. Here we will learn multiple ways through which we can generate thread dump for a java program. These instructions are […]

Read more
JavaMail Example - Send Mail in Java using SMTP — step-by-step Programming tutorial on Progressive Robot

JavaMail Example – Send Mail in Java using SMTP

URL: https://www.progressiverobot.com/javamail-example-send-mail-in-java-smtp/ Today we will look into JavaMail Example to send email in java programs. Sending emails is one of the common tasks in real life applications and that's why Java provides robust JavaMail API that we can use to send emails using SMTP server. JavaMail API supports both TLS and SSL authentication for sending […]

Read more
JUnit HTML Report — step-by-step Programming tutorial on Progressive Robot

JUnit HTML Report

URL: https://www.progressiverobot.com/junit-html-report/ When we configure maven-surefire-plugin to run our JUnit tests, it generates surefire-reports directory. This directory contains a txt file and an XML file for every test class. However, reading these files is not easy and it's also not easily explainable to a non-techie person. JUnit HTML Report We can use maven-surefire-report-plugin plugin to […]

Read more
Mockito Mock Static Method - PowerMock — step-by-step Programming tutorial on Progressive Robot

Mockito Mock Static Method – PowerMock

URL: https://www.progressiverobot.com/mockito-mock-static-method-powermock/ Mockito allows us to create mock objects. Since static method belongs to the class, there is no way in Mockito to mock static methods. However, we can use PowerMock along with Mockito framework to mock static methods. Mockito Mock Static Method using PowerMock PowerMock provides different modules to extend [Mockito framework](/community/tutorials/mockito-tutorial) and run […]

Read more
Pyramid Pattern Programs in Java — step-by-step Programming tutorial on Progressive Robot

Pyramid Pattern Programs in Java

URL: https://www.progressiverobot.com/pyramid-pattern-programs-in-java/ Pattern programs are used a lot in interviews to understand the logical thinking abilities of the interviewee. Pyramid patterns are very popular and once we get the logic on the way it's created, writing code to achieve the same is an easy task. Pyramid Pattern Programs in Java !Pyramid Pattern Programs in Java […]

Read more
How to Sort a HashMap by Value in Java? — step-by-step Programming tutorial on Progressive Robot

How to Sort a HashMap by Value in Java?

URL: https://www.progressiverobot.com/sort-hashmap-by-value-java/ HashMap in java provides quick lookups. They store items in "key, value" pairs. To get a value from the HashMap, we use the key corresponding to that entry. HashMaps are a good method for implementing Dictionaries and directories. Key and Value can be of different types (eg – String, Integer). We can sort […]

Read more
CHAT