Home Answers Viewqa Java-Beginners Doubt on Data Types

 
 


SakthiPrabhu.g
Doubt on Data Types
2 Answer(s)      4 years and 5 months ago
Posted in : Java Beginners

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 Pages:
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
doubt
data type like int,float which are not object 2)It does not support operator
data types
data types  Write a short note on data types of Java.   Please visit the following link: Java datatypes
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
Data types in a table
Data types in a table  hii, What are the data types allowed in a table?   hello,, These are the data types in table:- VARCHAR2, CHAR, NUMBER, RAW, DATE, LONG and LONG RAW.   hello,, These are the data
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
Hibernate Data types
This section lists Hibernate data types
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
big doubt
database contains a message of time  hi i have one doubt.if the database contains a message of time 05:00 to 06:00 the same msg should be displayed as marquee in the bottom of the page.below is the example if the data base
Data Types in Java 7
In this section we will discuss Java 7 Data Types
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
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
Java Data Types
Java Data Types      ... more primitive data types which are supported by Java language programming.... Following are the eight primitive data types: int It is a 32-bit signed two's
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
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- binary Bigint bit Char datetime decimal Float
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
doubt this
doubt this  what is the use of "this" and "super" keyword
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
Reference Data Types
Reference Data Types      ...;Reference Data Types Lets have a discussion about Reference Data Types in brief In Java a reference data type is a variable that can
DOUBT ?
DOUBT ?  in c++ member function of a class must be public
Doubt in struts - Struts
Doubt in struts  I am new to Struts, Can anybody say how to retrieve data from database and display it in jsp. Some said to use beans but i dont know how to do. Please help me in this regard. It will be helpful, if explained
DOubt in Mysql connections
DOubt in Mysql connections  i have some problem regarding data base connections, i have created a hostname, username and password in filezilla server but after i give those names also it is showing error like this: mysql
Primitive Data Types
Primitive Data Types In java, all the variables needs to be declared first... Data Types.... The value assigned to a variable determines its data type, on which the legal
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
Doubt in servlets - JSP-Servlet
Doubt in servlets  Good Evening sir/madam, I want to add data dynamically for that which methods i have to use to retrieve the dynamic data .  Hi Friend, Try the following code: 1
Java Data Types
Java Data Types      ... and then to be used. Java support eight types of primitive data types. Primitive data types are the data types already defined in Java. Following are the eight
Mapping MySQL Data Types in Java
Mapping MySQL Data Types in Java       Data types of MySQL and Java programming language... using MySQL data types and a application using Java data types. We need to provide
doubt - Date Calendar
doubt about retrieve dates from Database  Retrieve dates from... from the database with some condition in dates in jsp   Retrieve data from Database using JSP JSP Example Code for retrieving Data from Database<
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 - Java Beginners
doubt  is it possible to get the data from applet window for inserting into database using JDBC?i did this ,but it displays access denied..   Hi friend, import java.awt.Font; import java.awt.Color; import
doubt in connecting to mysql in flex - XML
doubt in connecting to mysql in flex  The ?Create application from... click on Validate Configuration;Now you can create your application!Choose Data... all!! i have doubt 2 set path of webroot n root URL and after valid
doubt in connecting mysql in flex - XML
doubt in connecting mysql in flex  The ?Create application from... click on Validate Configuration;Now you can create your application!Choose Data ->...!! i have doubt 2 set path of webroot n root URL and after valid coniguration pls
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
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... types into cell by using this method. In this example, we have used four data types
Built-in Simple Types
Built-in Simple Types Data types that are already defined in XML schema... are known as built-in data types. XML Schema provides many built-in data types. 19 Primitive Data Types: 1. boolean 2. string 3. decimal 4. double 5. float 6
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
Web hosting types
Web hosting types  Hi, Tell me about web hosting types. I want to know how many web hosting types are there? Thanks   Hi, These days many hosting companies are providing different types of web hosting services
Simple Types elements
specification provides a lot of built-in simple data types and you can also derive your own simple types...There are two types of elements: 1. Simple Type 2. Complex Type Simple types
types of relationships in tables
types of relationships in tables  How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?   hi... are implemented by splitting the data into two tables with primary key and foreign

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.