3:53 pm - Tuesday March 25, 8730

Integer 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
/**
 *@author :CandidJava.com
 *@descriptions : Basic Integer program using Equals();
 */
import java.io.*;

class EqualsEx {
	public static void main(String args[]) {
		Integer m = new Integer(200); // Object creation for integer class
		Integer n = new Integer(200); // Object creation for integer class
		boolean b = m.equals(n); // compares the two integer value and returns
		// true or false
		System.out.println(b);
	}
}

Output:

D:CandidJavalangInteger>javac EqualEx.java
D:CandidJavalangInteger>java EqualsEx
true

BACK

Filed in: Z-A All Java Codes

Comments are closed.