Following code is an example of generating a random alpha-numeric string using Java Random class. It is designed to generate random String of varying length based on the input parameter.
Many Java beginners find it difficult to differentiate between == operator and the “equals()” method when comparing String variables in Java. They assume that both operations perform the same function and either one can be used to compare two string variables. I have even seen many experienced programmers committing the mistake of using “==” to […]