Doubt on Data Types

Doubt on Data Types

View Answers

December 22, 2008 at 1:01 AM

import java.io.*;
class Ft
{
public static void main(String args[])
{
float f=4.5f; //ERROR ON FLOAT DECLARATION
System.out.println("Float Value.........:"+f);
}
}

you need to put f after 4.5 it is a float value na....so you need to put it in java.

December 22, 2008 at 4:13 AM

If you want to declare a decimal value in Java, it will be considered as double datatype by default. So to specifically mention a float datatype value you should add character 'f' or 'F' at the end of the value.

In your case it can be declared as float f=4.5f; or float f=4.5F;









Related Tutorials/Questions & Answers:
Doubt on Data Types - Java Beginners
Doubt on Data Types  Hi Friend doubt on DataTypes... How should i declare n Assign value to the Float variable; Can u Please COMPILE this Program...Explain in detail
data types
data types  Write a short note on data types of Java.   Please visit the following link: Java datatypes
Advertisements
Numeric Data Types
Numeric Data Types  Compare numeric data types of java with corresponding data types in C
JavaScript Data Types
JavaScript Data Types  What are JavaScript Data Types
Hibernate Data types
This section lists Hibernate data types
doubt this
doubt this  what is the use of "this" and "super" keyword
Data types in a table
Data types in a table  hii, What are the data types allowed in a table?   hello,,ADS_TO_REPLACE_1 These are the data types in table..._TO_REPLACE_2 These are the data types in table:- VARCHAR2, CHAR, NUMBER, RAW
Are arrays primitive data types?
Are arrays primitive data types?   Hi, Are arrays primitive data types? thanks   Hi, In Java, Arrays are objects. Identifier are some... as primitive data type
DOUBT ?
DOUBT ?  in c++ member function of a class must be public
Data Types in Java 7
In this section we will discuss Java 7 Data Types
Doubt
Doubt  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit details
Declaring Data Types in Java
Declaring Data Types in Java  What is the best way of declaring data types in Java?   http://www.roseindia.net/java/master-java/java-data... named 'byteident' which primitive data type is byte."); System.out.println
size of different basic data types
size of different basic data types   Write a simple program to find the size of different basic data types in java
Doubt
User request form  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit details.   1)page1.html: <html> <form type=get action="page2.html
Doubt
How to load page  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit details.   1)page1.html: <html> <form type=get action="page2.html
Doubt
Submit and process form  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit details.   1)page1.html: <html> <form type=get action
Doubt
load next page after submitting  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit details.   1)page1.html: <html> <form type=get action
doubt
data type like int,float which are not object 2)It does not support operator
Java Data Types
Java Data Types      ... on it. There are seven more primitive data types which are supported by Java language... is predefined in Java. Following are the eight primitive data types: int It is a 32-bit
Primitive Data Types
In this section we will discuss about Primitive Data Types in Java 7
Reference Data Types
In this section we will discuss about Reference Data Types in Java 7
What are the data types allowed in a table?
What are the data types allowed in a table?  What are the data types allowed in a table?   Hi, The data types allowed in a table are as follows-ADS_TO_REPLACE_1 binary Bigint bit Char datetime
java parsing of data types
java parsing of data types  Why its not works? char ch; String s=* ch=Character.parseChar(s) program: char op; DataInputStream dis=new DataInputStream(System.in); System.out.print("Enter operator (+,-,*,/,%): "); op
demonstrating understanding of data types
demonstrating understanding of data types  Design and implement a Java program that will gather a userā??s first name, middle initial, lastname, age in years, and 3 lucky numbers. The program should output the following based
Object with different data types
Object with different data types  Hello, I need to build a "patient" object that can contain String "name", String "ID", double "weight" and Date "birthDate". Then that object is referenced to the linked list. I know how to use
PHP Data Types
Data Types in PHP:  In programming language there are two types of data: atomic data and composite data, atomic data are those which can not broken further and composite data are just the opposite and it can be broken further
Data types in Oracle 9i - SQL
Data types in Oracle 9i  Cn anyone tell me the difference between timestamp wih time zone and timestamp with local timezone datatypes in oracle 9i.  Hi Friend, On Using TIMESTAMP WITH TIME ZONE, oracle store timezone
ModuleNotFoundError: No module named 'algebraic-data-types'
ModuleNotFoundError: No module named 'algebraic-data-types'  Hi...: No module named 'algebraic-data-types' How to remove the ModuleNotFoundError: No module named 'algebraic-data-types' error? Thanks   Hi
ModuleNotFoundError: No module named 'data-science-types'
ModuleNotFoundError: No module named 'data-science-types'  Hi, My... named 'data-science-types' How to remove the ModuleNotFoundError: No module named 'data-science-types' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'data-science-types'
ModuleNotFoundError: No module named 'data-science-types'  Hi, My... named 'data-science-types' How to remove the ModuleNotFoundError: No module named 'data-science-types' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'algebraic-data-types'
ModuleNotFoundError: No module named 'algebraic-data-types'  Hi...: No module named 'algebraic-data-types' How to remove the ModuleNotFoundError: No module named 'algebraic-data-types' error? Thanks   Hi
ModuleNotFoundError: No module named 'data-science-types'
ModuleNotFoundError: No module named 'data-science-types'  Hi, My... named 'data-science-types' How to remove the ModuleNotFoundError: No module named 'data-science-types' error? Thanks   Hi, In your
Primitive Data Types
Primitive Data Types In java, all the variables needs to be declared first... below : Java Data Types.... The value assigned to a variable determines its data type, on which the legal
Reference Data Types
Reference Data Types      ...;Reference Data Types Lets have a discussion about Reference Data Types in brief ADS_TO_REPLACE_1 In Java a reference data type
Python variables and data types
Python Tutorials: Learning variables and data types in Python with examples The variables and data types are essential topics in Python programming language. Programmers should learn to use various data types in Python Programming
Python variables and data types
Python Tutorials: Learning variables and data types in Python with examples The variables and data types are essential topics in Python programming language. Programmers should learn to use various data types in Python Programming
Java Data Types
Java Data Types        ... eight types of primitive data types. Primitive data types are the data types already defined in Java. Following are the eight primitive data types: int
Mapping MySQL Data Types in Java
Mapping MySQL Data Types in Java    ... mechanism for transferring data between an database using MySQL data types and a application using Java data types. We need to provide Java mappings
Conversion from string data type into different data types.
Conversion from string data type into different data types.  string str="World id Beutifull"; char chr[20]; char* chrctr ; Qustion is -How to store the 'str' value in 'chr' and 'chrctr'? int abc; sprintf(abc ,"%s",str
Validation doubt
have got that and implemented in my code but i have a doubt in that. As we try... that only numeric data. but i should be allowed to do the changes. Then how this can... think i am able to tell u what i want to and u have got whats my doubt. plz give
Passing Various Data Types into Cells
passing various data types into cells   ... data types into the cells and rows in the excel sheet using java .You can... add any data types into cell by using this method. In this example, we have used
I have one small doubt , does this code read Microsoft Office suit file format data such as .doc , .docx etc ?
I have one small doubt , does this code read Microsoft Office suit file format data such as .doc , .docx etc ?  import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class ReadFileExample
Set Data Types by using Prepared Statement
Set Data Types by using Prepared Statement   ... the method for setting data types (String, int, float and double) in the PreparedStatement interface of java.sql package. We know that the data types of MySQL and java
Flex Data Types
. Primitive Data types: int, uint, Number, Boolean, String, Null and void Complex Data types: Array, Date, Error, Function, RegExp...: #FFFFCC; } The data type of the variable defines the type of the value
doubt on DAO's
doubt on DAO's  hai frnds.... can anyoneexplain about how to integrate struts with hibernate,any predifined plugin is available or we need to create our own plugin????? and please help me. how to use dao s while integrating
doubt on DAO's
doubt on DAO's  hai frnds.... can anyoneexplain about how to integrate struts with hibernate,any predifined plugin is available or we need to create our own plugin????? and please help me. how to use dao s while integrating
doubt
doubt
doubt
Doubt

Ads