I want to create a method that uses dot(.) operator while calling in JAVA

String already has a compareTo.

If you’re talking about adding new methods to existing classes without access to the class’s source, like C#’s extension methods, that doesn’t exist in Java.

Leave a Comment