Java

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
Java Zip File Folder Example — step-by-step Programming tutorial on Progressive Robot

Java Zip File Folder Example

URL: https://www.progressiverobot.com/java-zip-file-folder-example/ Today we will look into java zip file example. We will also compress a folder and create zip file using java program. Java ZIP java.util.zip.ZipOutputStream can be used to compress a file into ZIP format. Since a zip file can contain multiple entries, ZipOutputStream uses java.util.zip.ZipEntry to represent a zip file entry. Java […]

Read more
JUnit Display Name - @DisplayName — step-by-step Programming tutorial on Progressive Robot

JUnit Display Name – @DisplayName

URL: https://www.progressiverobot.com/junit-display-name-displayname/ JUnit @DisplayName annotation is used to provide a custom name for the test class and test methods. We can use spaces, special characters, and even emojis in the display name. JUnit Display Name Example By default, [JUnit](/community/tutorials/junit5-tutorial) reporting prints the class name and method name in the IDE test report. We can use […]

Read more
Mockito mock examples — step-by-step Programming tutorial on Progressive Robot

Mockito mock examples

URL: https://www.progressiverobot.com/mockito-mock-examples/ Mockito mocking framework provides different ways to mock a class. Let's look at different methods through which we can mock a class and stub its behaviors. Mockito mock method We can use [Mockito](/community/tutorials/mockito-tutorial) class mock() method to create a mock object of a given class or interface. This is the simplest way to […]

Read more
SOAP Webservices in Java Example using Eclipse — step-by-step Programming tutorial on Progressive Robot

SOAP Webservices in Java Example using Eclipse

URL: https://www.progressiverobot.com/soap-webservices-in-java-example-eclipse/ Soap Webservices in java can be developed in may ways. We learned about [JAX-WS SOAP Web Services](/community/tutorials/jax-ws-tutorial) in our last tutorial, today we will learn how we can create SOAP web service and it's client program using Eclipse. Here we will not use JAX-WS, we will be using Apache Axis that is integrated […]

Read more
Thread Safety in Java Singleton Classes — step-by-step Programming tutorial on Progressive Robot

Thread Safety in Java Singleton Classes

Singleton is one of the most widely used creational design pattern to restrict the object creation by applications. In real world applications, resources like Database connections or Enterprise Information Systems (EIS) are limited and should be used wisely to avoid any resource crunch. To achieve this, we can implement Singleton design pattern to create a wrapper class around the resource and limit the number of object created at runtime to one.

Read more
Bridge Design Pattern in Java — step-by-step Programming tutorial on Progressive Robot

Bridge Design Pattern in Java

Today we will look into Bridge Design Pattern in java. When we have interface hierarchies in both interfaces as well as implementations, then bridge design pattern is used to decouple the interfaces from implementation and hiding the implementation details from the client programs. Bridge Design Pattern Just like [Adapter pattern](/community/tutorials/adapter-design-pattern-java "Adapter Design Pattern in Java […]

Read more
Composition in Java Example — step-by-step Programming tutorial on Progressive Robot

Composition in Java Example

Composition in java is the design technique to implement has-a relationship in classes. We can use [java inheritance](/community/tutorials/inheritance-java-example "Inheritance in Java Example") or Object composition in java for code reuse. Composition in Java ![composition in java, java composition, java composition example](images/composition-in-java-example-section-1.png) Java composition is achieved by using instance variables that refers to other objects. For […]

Read more
CHAT