Reverse a String using Recursion
Recursion is a technique in which a method keeps on making calls to itself until some break condition occurs. We can use this technique in the scenarios where we have to perform similar task repeatedly for a certain number of times. In this post, we will use recursion technique to reverse a string. This is …
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 …