Question: learn

Ads

 
 
 

Share on Google+Share on Google+

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

how to input value in java

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

Ads









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
Best Reasons to learn Java
Best Reasons to learn Java  Hi, What are the best reasons to learn Java? Why I should learn Java? Thanks   Hi, You should learn Java... all the types of Applications Java is easier to learn Java can be used for web
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
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
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
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
Tutorials   
Java Spring Hibernate Struts Training Apache Commons ioutils maven dependency Read/Convert an inputStream to a String What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include?

Ads

 
Advertisement null

Ads