1:58 am - Tuesday April 23, 2019

Character Example Program for equals(Object obj)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
<pre>// program for string_equals 
/**
 * @author:candidjava.com
 * @description:program to check given string is equal or not using
 *                      equals(object obj)
 */
public class StringEquals {
	public static void main(String args[]) {
		String p1 = "candid";
		String p2 = "java";
		// Are any of the above Strings equal to one another?
		Boolean equals1 = p1.equals(p2);
		// Display the results of the equality checks.
		System.out.println("\"" + p1 + "\" equals \" " + p2 + "= " + equals1);

	}
}</pre>
&nbsp;

 

OUTPUT:
“candid” equals “java”=false

Filed in: Z-A All Java Codes

Comments are closed.