it is the same as an int, String, or any of the others:
float myVar = 5.7f;
If you try to assign a decimal number you must place an "f" at the end, otherwise Java will assume you are trying to assign a double.
In C float a[8]; In Java float a[] = new float[8];
if u declare variable in method & tray to use this variable outside the method then it is out of scope
A variable declared as final can't be modified, once a value is assigned.
THIS IS FOR JAVA i don't know about anything about other languages yes it can be assignedthe syntax is:int (number) = (float) numberFOR EXAMPLE:int = a;a = (float ) 5.5;if the (float) is not there then in Java it gives an error saying precision loss of data type
Constants are defines using the final keyword.Variables are defined using the one of the keywords:charbooleanintdoublelongintStringTo use a constant you would have to put in something likedouble final pi = 3.14;
In C float a[8]; In Java float a[] = new float[8];
To convert a float to a double in Java, you can simply assign the float value to a double variable. Java will automatically perform the conversion for you. Here's an example: java float floatValue 10.5f; double doubleValue floatValue; In this example, the float value 10.5f is assigned to the double variable doubleValue, which will now hold the converted double value.
float myVariable = 20.1234;
if u declare variable in method & tray to use this variable outside the method then it is out of scope
A variable declared as final can't be modified, once a value is assigned.
int* pint; // instantiate a pointer to an int. float* pflt; // instantiate a pointer to a float.
You can declare them one by one. However, if you want to store lots of related data, you may want to consider using an array, where you use a single variable name (for example) for 1000 different items, and a number called an index to access the individual items.
THIS IS FOR JAVA i don't know about anything about other languages yes it can be assignedthe syntax is:int (number) = (float) numberFOR EXAMPLE:int = a;a = (float ) 5.5;if the (float) is not there then in Java it gives an error saying precision loss of data type
With the command return, followed by an object variable. In the method header, you have to declare the return type as the class of the object.
You declare a variable the same in a JSP as you do in a servlet. Let's say you want to declare a String variable called "foo" and you wanted to assign it a value of "bar." You would do this: String foo = "bar"; Of course, in a JSP, any Java code needs to be enclosed within <% and %>.
yes, float is keyword and data type in java
Constants are defines using the final keyword.Variables are defined using the one of the keywords:charbooleanintdoublelongintStringTo use a constant you would have to put in something likedouble final pi = 3.14;