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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sanjeev mittal
java programme
1 Answer(s)      a year and 2 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 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 - 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 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
Advertisements
 

 

 

DMCA.com