How to check java is strictly pass-by-value
Java is strictly pass-by-value. Meaning when we call a method, instead of the actual reference variable, a copy of it is sent to the method. Let’s consider below example You can be ascertain that the original value of variable val is still unaffected. This happens because local variable val in the method manipulateValue is a …
Different ways to create objects in java
There are several ways in which we can create java objects. In this post, we will have a look at some of these. 1. Using new keyword We have used this approach mostly to create objects in java. This is the most common and basic way. In this way, we call constructor with parameters or …