datatypes queries

datatypes queries

Respected sir ,what is the reason behind that java compiler gives me an error when float datatype isused to store float value?why we prefered double datatype for this?

View Answers

February 26, 2011 at 3:32 PM

You can use Scanner class. It is have a method nextFloat() which allow you to input float value.

import java.util.*;
class  ScannerExample
{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.print("Enter float value: ");
        float f=input.nextFloat();
        System.out.println(f);
    }
}

Ads









Related Tutorials/Questions & Answers:
datatypes queries
datatypes queries  Respected sir ,what is the reason behind that java compiler gives me an error when float datatype isused to store float value?why we prefered double datatype for this?   You can use Scanner class
datatypes in c++ and its sizes
datatypes in c++ and its sizes   What is mean by datatypes in C++ and what is the sizes of different datatypes
Advertisements
ModuleNotFoundError: No module named 'aiida-gaussian-datatypes'
ModuleNotFoundError: No module named 'aiida-gaussian-datatypes'  Hi...: No module named 'aiida-gaussian-datatypes' How to remove the ModuleNotFoundError: No module named 'aiida-gaussian-datatypes' error? Thanks  
ModuleNotFoundError: No module named 'datatypes-date-time'
ModuleNotFoundError: No module named 'datatypes-date-time'  Hi, My... named 'datatypes-date-time' How to remove the ModuleNotFoundError: No module named 'datatypes-date-time' error? Thanks   Hi
ModuleNotFoundError: No module named 'datatypes-timex-expression'
ModuleNotFoundError: No module named 'datatypes-timex-expression'  Hi...: No module named 'datatypes-timex-expression' How to remove the ModuleNotFoundError: No module named 'datatypes-timex-expression' error? Thanks
ModuleNotFoundError: No module named 'statscraper-datatypes-python'
ModuleNotFoundError: No module named 'statscraper-datatypes-python'  ...: No module named 'statscraper-datatypes-python' How to remove the ModuleNotFoundError: No module named 'statscraper-datatypes-python' error
ModuleNotFoundError: No module named 'statscraper-datatypes-python'
ModuleNotFoundError: No module named 'statscraper-datatypes-python'  ...: No module named 'statscraper-datatypes-python' How to remove the ModuleNotFoundError: No module named 'statscraper-datatypes-python' error
queries
queries
ModuleNotFoundError: No module named 'queries'
ModuleNotFoundError: No module named 'queries'  Hi, My Python... 'queries' How to remove the ModuleNotFoundError: No module named 'queries... to install padas library. You can install queries python with following command
Hibernate named queries
Hibernate named queries  Hi, What is named queries in Hibernate? Thanks
What are criteria Queries in Hibernate?
What are criteria Queries in Hibernate?  Just explain me what is Criteria Query in Hibernate with examples? Thanks   Criteria queries are very helpful in hibernate for queries based on certain criteria. Check
3 queries on java class
3 queries on java class  Hey. I need to do 3 queries on same class ( JAVA) One is to populate the combobox, the another one to populate tje jlist and the last one to use on button to open a file from database (BLOB) Can some
mysql run multiple queries at once
mysql run multiple queries at once  Running two MySQL queries at a time in PHP mysql_query
sql tips for optimizing queries
to optimize sql queries ?   Optimizing SQL Query Remove user-defined inline... actions with set-based queries Archive old data Avoid cursors   Optimizing... and the ways to replace cursors and looping actions with set-based queries Archive old
Need help with nested queries
Need help with nested queries  Hello, Table1 has "id", "votes" columns. Table2 has "id", "Name" column. I need to retrieve Name and its corresponging Votes. I tried with nested queries but its confusing. Can anyone please help
ModuleNotFoundError: No module named 'hgnc-queries'
ModuleNotFoundError: No module named 'hgnc-queries'  Hi, My Python... 'hgnc-queries' How to remove the ModuleNotFoundError: No module named 'hgnc-queries' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'smart-queries'
ModuleNotFoundError: No module named 'smart-queries'  Hi, My... 'smart-queries' How to remove the ModuleNotFoundError: No module named 'smart-queries' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-queries'
ModuleNotFoundError: No module named 'django-queries'  Hi, My... named 'django-queries' How to remove the ModuleNotFoundError: No module named 'django-queries' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'hgnc-queries'
ModuleNotFoundError: No module named 'hgnc-queries'  Hi, My Python... 'hgnc-queries' How to remove the ModuleNotFoundError: No module named 'hgnc-queries' error? Thanks   Hi, In your python
Version of com.eventsourcing>eventsourcing-queries dependency
List of Version of com.eventsourcing>eventsourcing-queries dependency
SQL QUERIES GUIDANCE
SQL QUERIES GUIDANCE  I have a query which returns 10 rows and 10 columns. Person_Id is primary key. The result set may be like Person_id Name, City, Telephone 1 Siva Pondy 1123 For each person_id
java datatypes - Java Beginners
ModuleNotFoundError: No module named 'core-custom-queries-app'
ModuleNotFoundError: No module named 'core-custom-queries-app'  Hi...: No module named 'core-custom-queries-app' How to remove the ModuleNotFoundError: No module named 'core-custom-queries-app' error? Thanks   
ModuleNotFoundError: No module named 'core-custom-queries-app'
ModuleNotFoundError: No module named 'core-custom-queries-app'  Hi...: No module named 'core-custom-queries-app' How to remove the ModuleNotFoundError: No module named 'core-custom-queries-app' error? Thanks   
ModuleNotFoundError: No module named 'django-debug-queries'
ModuleNotFoundError: No module named 'django-debug-queries'  Hi...: No module named 'django-debug-queries' How to remove the ModuleNotFoundError: No module named 'django-debug-queries' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-debug-queries'
ModuleNotFoundError: No module named 'django-debug-queries'  Hi...: No module named 'django-debug-queries' How to remove the ModuleNotFoundError: No module named 'django-debug-queries' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-no-lazy-queries'
ModuleNotFoundError: No module named 'django-no-lazy-queries'  Hi...: No module named 'django-no-lazy-queries' How to remove the ModuleNotFoundError: No module named 'django-no-lazy-queries' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-no-lazy-queries'
ModuleNotFoundError: No module named 'django-no-lazy-queries'  Hi...: No module named 'django-no-lazy-queries' How to remove the ModuleNotFoundError: No module named 'django-no-lazy-queries' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-tree-queries'
ModuleNotFoundError: No module named 'django-tree-queries'  Hi, My... named 'django-tree-queries' How to remove the ModuleNotFoundError: No module named 'django-tree-queries' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-visual-queries'
ModuleNotFoundError: No module named 'django-visual-queries'  Hi...: No module named 'django-visual-queries' How to remove the ModuleNotFoundError: No module named 'django-visual-queries' error? Thanks   Hi

Ads