Java

State Design Pattern in Java — step-by-step Programming tutorial on Progressive Robot

State Design Pattern in Java

URL: https://www.progressiverobot.com/state-design-pattern-java/ State design pattern is one of the behavioral design pattern. State design pattern is used when an Object change its behavior based on its internal state. State Design Pattern ![state design pattern, state design pattern in java, state pattern](images/state-design-pattern-java-section-1.png) If we have to change the behavior of an object based on its state, […]

Read more
Mockito @InjectMocks - Mocks Dependency Injection — step-by-step Programming tutorial on Progressive Robot

Mockito @InjectMocks – Mocks Dependency Injection

URL: https://www.progressiverobot.com/mockito-injectmocks-mocks-dependency-injection/ Mockito @InjectMocks annotations allow us to inject mocked dependencies in the annotated class mocked object. This is useful when we have external dependencies in the class we want to mock. We can specify the mock objects to be injected using [@Mock](/community/tutorials/mockito-mock-examples) or [@Spy](/community/tutorials/mockito-spy-partial-mock) annotations. Mockito @InjectMocks Mockito tries to inject mocked dependencies using […]

Read more
Fix for log4j WARN No appenders could be found for logger, Please initialize the log4j system properly — Programming tutorial on Progressive Robot

Fix for log4j WARN No appenders could be found for logger, Please initialize the log4j system properly

URL: https://www.progressiverobot.com/log4j-warn-no-appenders-could-be-found-for-logger-please-initialize-the-log4j-system-properly/ If you are reading this, you must be using log4j framework and got below error message. log4j:WARN No appenders could be found for logger log4j:WARN Please initialize the log4j system properly. log4j:WARN See https://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Log4j warning for no appenders will come to console for standalone applications and in server logs […]

Read more
How To Install Apache Tomcat 8 on Ubuntu 14.04 — step-by-step Linux tutorial on Progressive Robot

How To Install Apache Tomcat 8 on Ubuntu 14.04

Apache Tomcat is a web server and servlet container that is used to serve Java applications. Tomcat is an open source implementation of the Java Servlet and JavaServer Pages technologies, released by the Apache Software Foundation. This tutorial covers the basic installation and some configuration of the latest release of Tomcat 8 on your Ubuntu 14.04 server.

Read more
Java GZIP Example - Compress and Decompress File — step-by-step Programming tutorial on Progressive Robot

Java GZIP Example – Compress and Decompress File

URL: https://www.progressiverobot.com/java-gzip-example-compress-decompress-file/ Welcome to Java GZIP example. GZIP is one of the favorite tool to compress file in Unix systems. We can compress a single file in GZIP format but we can't compress and archive a directory using GZIP like ZIP files. Java GZIP ![GZIP, Java GZIP Example](images/java-gzip-example-compress-decompress-file-section-1.png) Here is a simple java GZIP example […]

Read more
Java 8 Interface Changes - static method, default method — step-by-step Programming tutorial on Progressive Robot

Java 8 Interface Changes – static method, default method

URL: https://www.progressiverobot.com/java-8-interface-changes-static-method-default-method/ Java 8 interface changes include static methods and default methods in interfaces. Prior to Java 8, we could have only method declarations in the interfaces. But from Java 8, we can have default methods and static methods in the interfaces. Java 8 Interface ![java 8 interface changes, java 8 interface, java interface static […]

Read more
Java Catch Multiple Exceptions, Rethrow Exception — step-by-step Programming tutorial on Progressive Robot

Java Catch Multiple Exceptions, Rethrow Exception

URL: https://www.progressiverobot.com/java-catch-multiple-exceptions-rethrow-exception/ In Java 7, catch block has been improved to handle multiple exceptions in a single catch block. If you are catching multiple exceptions and they have similar code, then using this feature will reduce code duplication. Let's understand java catch multiple exceptions feature with an example. Java catch multiple exceptions ![java catch multiple […]

Read more
Java Convert String to XML Document and XML Document to String — step-by-step Programming tutorial on Progressive Robot

Java Convert String to XML Document and XML Document to String

URL: https://www.progressiverobot.com/java-convert-string-to-xml-document-and-xml-document-to-string/ Sometimes while programming in java, we get String which is actually an XML and to process it, we need to convert it to XML Document (org.w3c.dom.Document). Also for debugging purpose or to send to some other function, we might need to convert Document object to String. Here I am providing two utility functions. […]

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
CHAT