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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


mayank parmar
learn
1 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


how to input value in java


Advertisement
View Answers

March 16, 2011 at 11:20 AM


You can use Scanner class, BufferedReader class to input values.

Here is an example:

import java.util.*;
class  ScannerExample
{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.print("Enter integer: ");
        int i=input.nextInt();
        System.out.print("Enter double: ");
        double d=input.nextDouble();
        System.out.print("Enter float: ");
        float f=input.nextFloat();
        System.out.print("Enter string: ");
        String s=input.next();
        System.out.println(i);
        System.out.println(d);
        System.out.println(f);
        System.out.println(s);
    }
}


Related Tutorials/Questions & Answers:
Learn Management
Learn Management  Hi, How to learn Management online? Thanks   Hi, You can learn management at Management tutorials section. Thanks
learn jquery
learn jquery   is it possible to learn myself jquery,ajax and json   Yes, you can learn these technologies by yourself. Go through the following links: Ajax Tutorials JSON Tutorials JQuery Tutorials
Advertisements
learn jquery
learn jquery   is it possible to learn myself jquery,ajax and json   Yes, you can learn these technologies by yourself. Go through the following links: Ajax Tutorials JSON Tutorials JQuery Tutorials
Learn spring
Learn spring  How a beginner can learn spring?   Learning spring is little difficult task. There are many modules of the spring framework. But you can start learning the spring core and gradually learn the other
to learn java
to learn java  I am b.com graduate. Can l able to learn java platform without knowing any basics software language.   Learn Java from the following link: Java Tutorials Here you will get several java tutorials
Learn Ajax
Learn Ajax  Hi, Give good links to learn ajax. What is the correct url at roseindia.net to learn Ajax? Thanks   Hi, If you are beginner in Ajax start learning from the index of Ajax tutorial. Start learning Ajax
Learn java
Learn java  Hi, I am absolute beginner in Java programming Language. Can anyone tell me how I can learn: a) Basics of Java b) Advance Java c) Java frameworks and anything which is important. Thanks
learn CVS
learn CVS  How i can use cvs in eclipse, How i can check in and cheack out my project
Guide me to learn Flex
Guide me to learn Flex  Guidance to learn Flex Thanks in Advance. Kamal   Please visit the following link: Flex Tutorials
Learn Java
There is a need to learn Java programming in today?s world as it has become..., there is need of Java, Hence it become more important for a programmer to learn... and server. If you are in need to learn Java quickly then the best way to achieve
i want to learn Jquery
i want to learn Jquery  i want to learn jquery can u plz guide me   Yes, you can learn these technologies by yourself. Go through the following links: Ajax Tutorials JSON Tutorials JQuery Tutorials
Learn PHP Tutorials for Beginners
Learn PHP Tutorials for Beginners  Hi, I am just pass-out from college and eager to learn the PHP. Can anyone suggest or provide me a resourceful information for php beginners. Thanks
learn sql - SQL
learn sql  how to learn sql......idont know anything about programming knowledge  Hi Friend, Please visit the following link: http://www.roseindia.net/sql/ Thanks
How to learn Hibernate?
How to learn Hibernate?  I am beginner in Hibernate. Now I want to learn Hibernate. Can anyone explain me how to learn Hibernate from scratch... learn the complete Hibernate. Check the tutorial Hibernate examples and articles
Where to learn Struts 2?
Where to learn Struts 2?  Hi, I am beginner in Struts and trying to find good tutorial to learn Struts 2 framework. My project is in Struts 2 and soon I have to work on the project. Let's know where to learn the Struts 2
How to learn PHP?
How to learn PHP?  Hi, How I can learn PHP easily? Thanks  Hi Friend, Please visit the following link: http://www.roseindia.net/php/ Thanks  Hi Friend, Please visit the following link: http
How we learn java
How we learn java  what is class in java? what is object in java? what is interface in java and use? what is inheritence and its type
How we learn java
How we learn java  what is class in java? what is object in java? what is interface in java and use? what is inheritence and its type
How we learn java
How we learn java  what is class in java? what is object in java? what is interface in java and use? what is inheritence and its type
How we learn java
How we learn java  what is class in java? what is object in java? what is interface in java and use? what is inheritence and its type
How we learn java
How we learn java  what is class in java? what is object in java? what is interface in java and use? what is inheritence and its type
How to learn programming free?
How to learn programming free?  Is there any tutorial for learning... programming on RoseIndia.net which you can learn free of cost. These are: Hi, Here are the tutorials: Beginners Java Tutorial Learn Java in a day Master Java
How to learn Quartz?
How to learn Quartz?  Hi, I have to make a program in Java is scheduling account processing Job after an interval of 20 minutes. Tell me the tutorial. Thanks   Hi, Please check the tutorial Hello World Quartz
How can I learn Java?
How can I learn Java?  Hi, I have just completed a course in HTML.... Now I want to learn Learn Java programming and become the expert in Java programming. How can I learn Java? in shortest possible time. I mean I just want to begin
Easiest way to learn Java
There are various ways to learn Java language but the easiest way to learn... to learn the language from the comforts of their home. Every topic and chapter... to learn. Online learning is similar sometimes better than classroom training
Wt is easy way to learn UML
Wt is easy way to learn UML  Hello Friends, Please guide me,How to learn UML in easy way and efficent way. Thanks in Adavance Thanks, Abiram
Please help me to learn - WebSevices
Please help me to learn  Please help me to learn Java Fast
Where to learn java programming language
Where to learn java programming language  I am beginner in Java and want to learn Java and become master of the Java programming language? Where to learn java programming language? Thanks   Hi, Java is Object
Learn Spring Framework from where?
Learn Spring Framework from where?  I want to learn the Spring... the documentation but it does not have the easy to learn examples. So, these are not good... to understand. Where can I find the projects to learn Spring framework? Thanks
Advertisements
 

 

 

DMCA.com