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




Have Programming Question? Ask it here!
 
 
 


sanjeev mittal
java programme
1 Answer(s)      11 months ago
Posted in : Java Beginners


1.....programme for reading 10 values for 10 variables using scanner class

2....declares all types of primitive data inside main method


Advertisement
View Answers

August 14, 2013 at 1:25 PM


package net.roseindia;

import java.util.Scanner;

public class ReadValue {
    public static void main(String args[]) {

        Scanner in = new Scanner(System.in);

        int integer;
        long longInteger;
        float realNumber;
        double doubleReal;
        byte byteRead;
        boolean booleanRead;

        short  shortRead;
        String string1;
        String string2;
        System.out.println("Enter an integer values, A long integer values, " + "A floating-point, "+" A Byte, " +"A boolean");
         integer = in.nextInt();
         longInteger = in.nextLong();
         realNumber = in.nextFloat();
         byteRead = in.nextByte();
         booleanRead = in.nextBoolean();
         System.out.println("number, another floating-point values, " + "and a string values." +"A Double, "+ " A Short");
         doubleReal = in.nextDouble();
        shortRead = in.nextShort();
         string1 = in.nextLine();
         string2 = in.next();

         System.out.println(integer + " " + longInteger + " " + realNumber +" " + doubleReal + "" 
                                    + byteRead + " " + booleanRead + " " + shortRead + " " + string1 
                                      +" and " + string2);

}



}


Related Tutorials/Questions & Answers:
java programme
java programme   1.....programme for reading 10 values for 10 variables using scanner class 2....declares all types of primitive data inside main method
java programme
java programme   i have to write a java programe that calculates the average of 10 students in Test 1 ,Test 2 and Test 3....Values of the marks in all the test for a student should be hardcore.Ialso have to tell the maixmum
Advertisements
Java programme
Java programme  Write a program to get student grade for 3 different subjects, and display the CGPA for them
programme - Java Beginners
programme  java programme to implement stack operation?use stack to check whether a given string is polidrome or not  Hi Friend, Please...://www.roseindia.net/java/example/java/util/StackImplement.shtml Use following code
Java programme - Java Beginners
Java programme  Develop a multi-threaded GUI application using java application
Java programme - Date Calendar
Java programme  Can you provide me the coding for Date class provided by java util package
Problem on JAVA Programme
Problem on JAVA Programme  public class AA { int add(int i) { int y = i; y += 20; if (y <= 100){ y +=30;add(y);} System.out.println("Final Value of y : " + y); return y; } public static void main
JAVA programme - JDBC
JAVA programme  Prepare a class ?String_Example? following the basic functionality of ?String ?type of JAVA. Use of dynamic character arrays for such class is encouraged. Following is expected from the completed Program
JAVA programme - Java Interview Questions
JAVA programme  Perpare a class "package_example" following the basic functionality of "string" type in JAVA.Use of dynamic character arrays for such class is encouraged.Following is expected from the programme: a.Use of 3
programme
programme  Using an ATM, customer can access their bank accounts in order to credit/debit cash and check their account balances.You have to write c programme to implement a simple ATM for 15 customers. Initially you have to store
java programme - Java Server Faces Questions
java programme  Write a complete program, which prints all Fibonacci numbers that are less than 1600.  Hi Friend, Try the following code: public class FibonnaciSeries { public static void main(String[] args
How to add a file in GZIP file format in Java programme.
How to add a file in GZIP file format in Java programme.  Hi please help me. How to add a file GZIP File format in Java program. If example... in Gzip file format. For details visit http://www.roseindia.net/java/examples
menu driven programme
menu driven programme   calculate the area of circle, square, rectangle in menu driven programme in java
hotel management programme in c language?
hotel management programme in c language?  hotel management programme in c language
compiling programme IJVM
compiling programme IJVM  I TRY AND COMPILE THE PROGRAMME BELOW BUT HAS ERROR APPEAR ALL THE TIME,,CAN ANYONE CORRECT THE CODE AND WRITE UP THE NEXT METHOD FOR POWER IN THE PROGRAME AS WELL...URGENT // Program to read two single
please solve the programme
please solve the programme  Develop a java program to find the roots of a quadratic equation ax2+bx+c=0, with the following specification :- Class name :- Quad Data members float a,b,c,d, with a,b,c are the co-efficient
applet images sleeping programme - Applet
-------------------------------------------------------- Read for more information. http://www.roseindia.net/java/example/java/applet/ Thanks
making consistency of data member in the whole programme without using static keyword
making consistency of data member in the whole programme without using static keyword  In the below programme i use one boolean variable named check... . But the value of check variable is not maintained in the programme . we can
java
java  where i write java programme and how do i execute the programme
java
java  Write a programme in java to take the value of A and B as input and print the value of(A+B)3 and (A+B)2
java - Java Beginners
java  write a java programme to draw diagram for function f(x)=x*x
menu drive programm in java
menu drive programm in java  calculate area of circle, square,rectangele in menu driven programme in java
menu drive programm in java
menu drive programm in java  calculate area of circle, square,rectangele in menu driven programme in java
JAVA - Java Beginners
JAVA  WRITE A PROGRAMME FOR SIMPLE CALCULATOR  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Thanks
java - Java Beginners
java  write a programme to to implement queues using list interface  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/util/QueueImplement.shtml Thanks
Java GUI - Java Beginners
Java GUI  How to use JTray in java programme?  Hi friend, JTrayIcon jtc= new JTrayIcon(image); // jPopupMenu is a javax.swing.JPopupMenu jtc.setRightClickTarget(jPopupMenu); jtc.show(); Thanks
java - Java Beginners
java  Hii Can any ome help me to Write a programme to merge pdf iles using itext api.  Hi friend, For solving the problem visit to : http://www.roseindia.net/java/itext/ Thanks
java coding
java coding  Hi sir, WRITE A PROGRAMME TO MAKE EMPLOYMENT MANAGMENT HAVING COLORS AND FRAME IN IT,???? CAN U SUGGEST ME HOW TO MAKE IT IN CORE JAVA
java IO
java IO  Write a Java program to accept a file name as command line argument. Append the string "File Modified by Programme" to the end of the same file and print the contents of the modified File
java applets - Java Beginners
a java applet programme to implement moving a ball from top to bottom... without using swing or jframes 9.write a java programme to draw diagram for function f...java applets  1.write main method for display clock applet including
developing skills in java , j2ee - Java Beginners
developing skills in java , j2ee   How to understand or to feel the flow of java or j2ee programme what is the way to become a expert programmer can you please give me tips thanking you
Hp scanner - Java Beginners
Hp scanner  Hi guys, i would like to access hp scanner using java programme. could you refer me some useful information to proceed
java - Java Beginners
java  1)write a java applet programme to implement moving a ball from top to bottom  Hi Friend, Please visit the following link and create applet from the code: http://www.roseindia.net/java/example/java
java - Java Beginners
java  write a programme to implement linked list using list interface  Hi Friend, Please visit the following link to learn about the implementation of LinkedList . http://www.roseindia.net/java/java-tips/data
java - Java Beginners
java  write a programme to count the no. of customers in bank using static variable
java programming - Java Beginners
java programming  write and run a programme that accept a string from keyboard and convert it into a number.  Hi Friend, Please visit the following link: http://www.roseindia.net/java/java-conversion
java programming structure - Java Beginners
java programming structure  java programming structure  Hi Friend, The structure of Java programme is: [Package declarations] [Import statements] [Class declaration] [Method declaration] eg: package
program - Java Beginners
Program and Programme Difference  What is the difference between program and programmer
Java - Java Interview Questions
Java  Hi How to write java code inorder to get the comments written in a java program? Please let me know..this was asked in my interview... in details. For more information on Java visit to : http://www.roseindia.net/java
programmes - Java Beginners
programmes  programme to implement matrix class with addition...://www.roseindia.net/java/beginners/MatrixMultiply.shtml http://www.roseindia.net/java/beginners/MatrixSum.shtml http://www.roseindia.net/java/java-conversion/Dividing-of-two
java - Java Beginners
java  java programme to sort set of numbers in ascending order  Hi Friend, Sorting in java is very easy because of the use of Collections.sort() method. Here we are sending you the sample code to sort some numbers
Java Programming - Java Beginners
Java Programming  how to make programme to make a star with for loop in console (CUI)?  Hi friend, import java.io.*; public...(); } } } ------------------------------------------------ Read for more information. http://www.roseindia.net/java/ Thanks
java - Java Beginners
java  how to write a programme in java to copy one line file to another file.name of file are entered through a keyboard  Hi Friend, Try the following code: import java.io.*; import java.util.*; public class
chat - Java Beginners
chat   basic concept of chatting.. how will we connect the online users ? requirements for a chatting programme
Java Game Pontoon
Java Game Pontoon  Could someone help me create a programme for the game pontoon //play a game of pontoon import java.util.*; public class Pontoon { public static void main (String args[]) { //deal initial hands
java
java  1.write a prograame to create applet which display text hello in bold ,text color should be red. 2.Write a programme that convert the temperature from Celsius to fahernheit. make use of the AWT. 3.write a prograame
java
java  1.write a prograame to create applet which display text hello in bold ,text color should be red. 2.Write a programme that convert the temperature from Celsius to fahernheit. make use of the AWT. 3.write a prograame
 

 

 

DMCA.com