Java

Java Write to File - 4 Ways to Write File in Java — step-by-step Programming tutorial on Progressive Robot

Java Write to File – 4 Ways to Write File in Java

URL: https://www.progressiverobot.com/java-write-to-file/ Java provides several ways to write to file. We can use [FileWriter](/community/tutorials/java-filewriter-example), [BufferedWriter](/community/tutorials/java-bufferedwriter), java 7 [Files](/community/tutorials/java-files-nio-files-class) and [FileOutputStream](/community/tutorials/java-fileoutputstream) to write a file in Java. Java Write to File ![java write to file, write file in java](images/java-write-to-file-section-1.png) Let's have a brief look at four options we have for java write to file operation. FileWriter: […]

Read more
java.lang.NoClassDefFoundError — step-by-step Programming tutorial on Progressive Robot

java.lang.NoClassDefFoundError

URL: https://www.progressiverobot.com/java-lang-noclassdeffounderror/ java.lang.NoClassDefFoundError is runtime error thrown when a required class is not found in the classpath and hence JVM is unable to load it into memory. java.lang.NoClassDefFoundError NoClassDefFoundError is a runtime error, so it's beyond our application scope to anticipate and recover from this. java.lang.NoClassDefFoundError is a runtime error, it never comes in compile […]

Read more
Java Heap Space vs Stack - Memory Allocation in Java — step-by-step Programming tutorial on Progressive Robot

Java Heap Space vs Stack – Memory Allocation in Java

URL: https://www.progressiverobot.com/java-heap-space-vs-stack-memory/ Sometime back we wrote a couple of posts about [Java Garbage Collection](/community/tutorials/java-jvm-memory-model-memory-management-in-java) and [Java is Pass by Value](/community/tutorials/java-is-pass-by-value-and-not-pass-by-reference "Java is Pass by Value and Not Pass by Reference"). After that we got a lot of emails to explain about Java Heap Space, Java Stack Memory, Memory Allocation in Java and what are the […]

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
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
What is += Addition Assignment Operator in Java? — step-by-step Programming tutorial on Progressive Robot

What is += Addition Assignment Operator in Java?

It's the Addition assignment operator. Let's understand the += operator in Java and learn to use it for our day to day programming. x += y in Java is the same as x = x + y. It is a compound assignment operator. Most commonly used for incrementing the value of a variable since x++ […]

Read more
How To Install Java with Apt-Get on Debian 8 — step-by-step Linux tutorial on Progressive Robot

How To Install Java with Apt-Get on Debian 8

This tutorial will guide you through the process of installing and managing different versions of Java using apt-get on Debian 8. The programming language Java and the Java virtual machine or **JVM** are extensively used and required for many kinds of software.

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

Java Spliterator

URL: https://www.progressiverobot.com/java-spliterator/ Java Spliterator is one of the four iterators – Enumeration, [Iterator](/community/tutorials/java-iterator), [ListIterator](/community/tutorials/java-listiterator) and Spliterator. Java Spliterator Like Iterator and ListIterator, Spliterator is a Java Iterator, which is used to iterate elements one-by-one from a [List](/community/tutorials/java-list) implemented object. Some important points about Java Spliterator are: Java Spliterator is an interface in [Java Collection](/community/tutorials/collections-in-java-tutorial) API. […]

Read more
How To Install Java on CentOS, Rocky Linux, RHEL, and Fedora — step-by-step Linux tutorial on Progressive Robot

How To Install Java on CentOS, Rocky Linux, RHEL, and Fedora

This tutorial will show you how to install Java on current versions of RPM-based Linux distributions: Red Hat Enterprise Linux, CentOS, Fedora, and Rocky Linux. Java is a popular programming language and software platform that allows you to run many server-side applications. This tutorial covers installing the latest, default version of Java, as well as cherry-picking any older versions for installation, and switching between multiple versions in your environment as needed.

Read more
CHAT