Java

Java Queue – Queue in Java — step-by-step Programming tutorial on Progressive Robot

Java Queue – Queue in Java

URL: https://www.progressiverobot.com/java-queue/ Java Queue is an interface available in java.util package and extends java.util.Collection interface. Just like Java List, Java Queue is a collection of ordered elements (Or objects) but it performs insert and remove operations differently. We can use Queue to store elements before processing those elements. ![](images/java-queue-section-1.png) Java Queue In this section, we […]

Read more
Java Socket Programming - Socket Server, Client example — step-by-step Programming tutorial on Progressive Robot

Java Socket Programming – Socket Server, Client example

URL: https://www.progressiverobot.com/java-socket-programming-server-client/ Welcome to Java Socket programming example. Every server is a program that runs on a specific system and listens on a specific port. Sockets are bound to the port numbers and when we run any server it just listens on the socket and waits for client requests. For example, tomcat server running on […]

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

Java Thread Example

URL: https://www.progressiverobot.com/java-thread-example/ Welcome to the Java Thread Example. Process and Thread are two basic units of execution. Concurrency programming is more concerned with java threads. Process A process is a self contained execution environment and it can be seen as a program or application. However a program itself contains multiple processes inside it. Java runtime […]

Read more
Java SE 8 Interview Questions and Answers (Part-1) — step-by-step Programming tutorial on Progressive Robot

Java SE 8 Interview Questions and Answers (Part-1)

URL: https://www.progressiverobot.com/javase8-interview-questions-part1/ In this post, we are going to discuss some important [Java SE 8](/community/tutorials/java-8-features-with-examples) Interview Questions with Answers. I will write one more post to discuss the remaining Java SE 8 Interview Questions. Java 8 Interview Questions Why do we need change to Java again? Java SE 8 New Features? Advantages of Java SE […]

Read more
JUnit Setup Maven - JUnit 4 and JUnit 5 — step-by-step Programming tutorial on Progressive Robot

JUnit Setup Maven – JUnit 4 and JUnit 5

URL: https://www.progressiverobot.com/junit-setup-maven/ JUnit 4 and JUnit 5 are completely different frameworks. They both serve the same purpose, but the JUnit 5 is a completely different testing framework written from scratch. It's not using anything from JUnit 4 APIs. Here we will look into how to setup JUnit 4 and [JUnit 5](/community/tutorials/junit5-tutorial) in our maven projects. […]

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

Mockito Mock Void Method

URL: https://www.progressiverobot.com/mockito-mock-void-method/ Most of the times Mockito when() method is good enough to mock an object's behavior. But when we have to mock a void method, we can't use when(). Mockito Mock Void Method Mockito provides following methods that can be used to mock void methods. doAnswer(): We can use this to perform some operations […]

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
Thread Safety in Java — step-by-step Programming tutorial on Progressive Robot

Thread Safety in Java

URL: https://www.progressiverobot.com/thread-safety-in-java/ Thread Safety in Java is a very important topic. Java provides multi-threaded environment support using Java Threads, we know that multiple threads created from same Object share object variables and this can lead to data inconsistency when the threads are used to read and update the shared data. Thread Safety ![thread safe, thread […]

Read more
CHAT