Java

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
Proxy Design Pattern — step-by-step Programming tutorial on Progressive Robot

Proxy Design Pattern

URL: https://www.progressiverobot.com/proxy-design-pattern/ Proxy Design pattern is one of the Structural design pattern and in my opinion one of the simplest pattern to understand. Proxy Design Pattern ![proxy design pattern](images/proxy-design-pattern-section-1.png) Proxy design pattern intent according to GoF is: Provide a surrogate or placeholder for another object to control access to it. The definition itself is very […]

Read more
How to Shuffle an Array in Java — step-by-step Programming tutorial on Progressive Robot

How to Shuffle an Array in Java

URL: https://www.progressiverobot.com/shuffle-array-java/ There are two ways to shuffle an array in Java. Collections.shuffle() Method Random Class 1. Shuffle Array Elements using Collections Class We can create a list from the array and then use the Collections class shuffle() method to shuffle its elements. Then convert the list to the original array. package com.journaldev.examples; import java.util.Arrays; […]

Read more
Thread Life Cycle in Java - Thread States in Java — step-by-step Programming tutorial on Progressive Robot

Thread Life Cycle in Java – Thread States in Java

URL: https://www.progressiverobot.com/thread-life-cycle-in-java-thread-states-in-java/ Understanding Thread Life Cycle in Java and Thread States are very important when you are working with Threads and programming for multithreaded environment. From our last tutorial, we can create a [java thread](/community/tutorials/java-thread-example "Java Thread Example – Extending Thread Class and Implementing Runnable Interface") class by implementing Runnable interface or by extending Thread […]

Read more
Abstract Class in Java — step-by-step Programming tutorial on Progressive Robot

Abstract Class in Java

Abstract class in Java is similar to interface except that it can contain default method implementation. An abstract class can have an abstract method without body and it can have methods with implementation also. abstract keyword is used to create a abstract class and method. Abstract class in java can't be instantiated. An abstract class […]

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

Abstract Factory Design Pattern in Java

Welcome to Abstract Factory Design Pattern in java example. Abstract Factory design pattern is one of the Creational patterns. Abstract Factory pattern is almost similar to [Factory Pattern](/community/tutorials/factory-design-pattern-in-java) except the fact that its more like factory of factories. Abstract Factory ![abstract factory, abstract factory design pattern, abstract factory pattern](images/abstract-factory-design-pattern-in-java-section-1.png) If you are familiar with [factory […]

Read more
Compare Functional Programming, Imperative Programming and Object Oriented Programming — step-by-step Programming tutorial on Progressive Robot

Compare Functional Programming, Imperative Programming and Object Oriented Programming

As Oracle Corporation has introduced some Functional constructs in Java SE 8, now-a-days most of the Interviewers are interested to ask some questions about Functional Programming. As a Java/Groovy/Scala Developer or any Functional Programming Developer, we should learn the following questions and answers to clear interviews: … And More What is Functional Programming? What are […]

Read more
CHAT