Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners datatypes queries
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Indrajeet T. Zade
datatypes queries
1 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners


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?


Advertisement
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);
    }
}


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
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
JPA Native Queries, JPA Native Queries Tutorials
JPA Native Queries       In this section, you will know about the jpa native queries and how to use native query in your JPA application.  JPA Native Queries: JPA native
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
doubts for sub queries in mysql
doubts for sub queries in mysql  how to display the details of one table by checking the conditions in the next table using some condition eg., mysql> select * from student where number=(select id from studentpersonal where
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
mysql run multiple queries at once
mysql run multiple queries at once  Running two MySQL queries at a time in PHP mysql_query
to add on to my queries - Java Beginners
to add on to my queries   Dear Experts, Sorry but I am worried that I did not explain clearly so I am adding in the error message I get from Netbean IDE when I run that queries using the last solution provided. I'm puzzled
Hibernate Polymorphic Queries
Hibernate Polymorphic Queries In this tutorial you will learn about the HQL polymorphic queries. Hibernate supports the polymorphic queries. Polymorphic means the polymorphism i.e an object that has a IS-A relation with their own type
SQL Aggregate Queries
SQL Aggregate Queries       SQL Aggregate Queries show you the list of Aggregate Function that include... The Tutorial illustrate an example from 'SQL Aggregate Queries'. To understand
JPA Sub-Queries
JPA Sub-Queries       In this section, you will see how to use sub-queries in your JPA application. Sub-queries allows you for querying the vast number of data
two select queries shouldn't depend on each other
two select queries shouldn't depend on each other   i want to write two select queries such that both queries shouldn't depends on each other .or how can i re-write this query? can i write this without using where
update database using two queries at a time
update database using two queries at a time  String sql="insert into employee values(emp_seq.nextval,\'"+ename+"\',\'"+eadd+"\',\'"+ephone... can execute two queries with two different Statement object in the following way
JPA Named Queries
JPA Named Queries       In this section, you will know about the JPA Named Queries...;) }) For developing JPA Named Queries, you need the following files
Does java supports queries with references/Table alias?
Does java supports queries with references/Table alias?  Hello, I have an Oracle query:SQL> select t.TopicName, p.NumberofPolls from EMSTopic t,EMSPoll p where t.TopicID = p.TopicID and t.TopicName= 'Sybase'; which
Google Ranking Update for Spammy Queries
ranking update today for some spammy queries". This update was worldwide and many... in their ranking and disappeared from search results. This update targets spam queries... percent of English queries. It is a work in progress and will be completely
Execute SQL Queries with Java Application
Execute SQL Queries with Java Application       This is detailed java program to connect java application and execute queries like create table in mysql database, insert some
some queries pertaining to use of log4j for logging in a java application-
some queries pertaining to use of log4j for logging in a java application-  Please clarify the following for me- (1) I want to use a rollingfile appender, that too in such a way that the actual log file (to which log4j should
How sql Queries possible in DAO without creating Database connections - Java Beginners
How sql Queries possible in DAO without creating Database connections  In DAO we are writting sql queries , how it is possible without creating and closing database connections
 

 

 

DMCA.com