java float example
float f1 = 5.5f;
float f2 = 5.4f;
how would you initialize a static float without using the wrapper class?
static float f1 = 5.5f
would that be correct?
Jump to PostDid you try it out?
Did you try it out?
Yes, it works, but like firstPerson said just try it next time.
You could also use
public static float afp = (float)2.34; //or any decimal value
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.