Java Program to Print Random Character of String

In this post, we will look at how to print random characters from a String in Java. Logic: Generate a random index using the Math.random() Convert index to int Find the character at that index from the String and print it Program Let’s have a look at the program. Output:

Java 8 Lambda Void argument

Java 8 Lambda Void argument becomes mandatory even if you don’t want to pass it. In this post, we will look at how to remove it using a helper method in the interface. Let’s see how to call the action method with Void argument v. How to remove the Void Read more…