Member Avatar for axn

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?

Member Avatar for mrnutty

Did you try it out?

Member Avatar for BestJewSinceJC

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.