Java

Java FileWriter Example — step-by-step Programming tutorial on Progressive Robot

Java FileWriter Example

URL: https://www.progressiverobot.com/java-filewriter-example/ Java FileWriter Java FileWriter class is a part of java.io package. FileWriter is a sub class of java.io.OutputStreamWriter class. FileWriter is meant for writing streams of characters. FileWriter is used to write to character files. Its write() methods allow you to write character(s) or strings to a file. FileWriters are usually wrapped by […]

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

Inheritance in Java Example

URL: https://www.progressiverobot.com/inheritance-java-example/ Inheritance in java is one of the core concepts of Object-Oriented Programming. Java Inheritance is used when we have is-a relationship between objects. Inheritance in Java is implemented using extends keyword. Inheritance in Java Inheritance in Java is the method to create a hierarchy between classes by inheriting from other classes. Java Inheritance […]

Read more
EasyMock Void Method - expectLastCall() — step-by-step Programming tutorial on Progressive Robot

EasyMock Void Method – expectLastCall()

Sometimes we want to mock void methods. EasyMock expect() method can't be used to mock void methods. However, we can use expectLastCall() along with andAnswer() to mock void methods. EasyMock void method When we use expectLastCall() and andAnswer() to mock void methods, we can use getCurrentArguments() to get the arguments passed to the method and […]

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

Adapter Design Pattern in Java

Adapter design pattern is one of the structural design pattern and its used so that two unrelated interfaces can work together. The object that joins these unrelated interface is called an Adapter. Adapter Design Pattern ![adapter design pattern, adapter design pattern in java, adapter pattern, adapter pattern java example](images/adapter-design-pattern-java-section-1.png) One of the great real life […]

Read more
Java Dependency Injection - DI Design Pattern Example Tutorial — step-by-step Programming tutorial on Progressive Robot

Java Dependency Injection – DI Design Pattern Example Tutorial

URL: https://www.progressiverobot.com/java-dependency-injection-design-pattern-example-tutorial/ Java Dependency Injection design pattern allows us to remove the hard-coded dependencies and make our application loosely coupled, extendable and maintainable. We can implement dependency injection in java to move the dependency resolution from compile-time to runtime. Java Dependency Injection Java Dependency injection seems hard to grasp with theory, so we would take […]

Read more
log4j.properties File Example — step-by-step Programming tutorial on Progressive Robot

log4j.properties File Example

URL: https://www.progressiverobot.com/log4j-properties-file-example/ In [log4j tutorial](/community/tutorials/log4j-tutorial), we saw how to use log4j xml based configuration. But log4j.xml is verbose, so log4j framework provide option to read configuration from properties file too. Since properties file don't have any defined schema to validate, we have to be more careful with it. Today we will see how XML configurations […]

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

OOPS Concepts in Java – OOPS Concepts Example

URL: https://www.progressiverobot.com/oops-concepts-java-example/ Object-Oriented Programming Concepts are very important for programming. Without having an idea about OOPS concepts, you will not be able to design systems in the object-oriented programming model. What is Object-Oriented Programming Model? The object-oriented programming model revolves around the concept of Objects. What is an Object? An object is an instance of […]

Read more
String to byte array, byte array to String in Java — step-by-step Programming tutorial on Progressive Robot

String to byte array, byte array to String in Java

URL: https://www.progressiverobot.com/string-byte-array-java/ Today we will learn how to convert String to byte array in java. We will also learn how to convert byte array to String in Java. String to byte array We can use String class getBytes() method to encode the string into a sequence of bytes using the platform's default charset. This method […]

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
CHAT