2:29 am - Tuesday April 23, 2019

Float Example program for compare(float f1, float f2)

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 : This program Compares the two specified float values.
*/
public class FloatCompare
{
public static void main(String ar[]) throws Exception
{
Float f1=new Float(0.5);
Float f2=new Float(0.63);
                        //two objects created for float class and float values assigned for created objects.
float f=Float.compare(f1,f2);           // compared float values to check equal or not
System.out.println("Float Compared Value:"+f);           //o/p printed
}
}

Output:
FloatCompared Value : -1.0

BACK

Filed in: Z-A All Java Codes

Comments are closed.