Harshit Rathore

String Class Methods in Java

equalsIgnoreCase() We use this method to perform the case insensitive comparison between 2 strings. Prototype: public boolean equalsIgnoreCase(String str) Example: String str = “STEVE”; String s = “steve”; System.out.println(str.equals(s)); //output will be “true” subString() This method returns the sub string beginning at the given index to the end of the string. Prototype: public String subString(int …

String Class Methods in Java Read More »

Hashcode() and CLone() – Methods of Object Class in Java

We have already discussed about the toString() method so now we will explain the remaining 10 methods of Object class in java.lang package. 2) hashCode(): Prototype of this method is public native int hashCode() In java, JVM assigns one unique id to every object through which we can represent it in the memory. This unique …

Hashcode() and CLone() – Methods of Object Class in Java Read More »