OneCompiler

🔴Basic Intro To Java🔵

217

import java.util.*;
public class Intro {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Type here to print on the screen");
int d=sc.nextInt();//to take integer input
double a=sc.nextDouble();//to take input of double datatype
short r=sc.nextShort();//to take input of short datatype
long i=sc.nextLong();//to take input of long datatype
char v=sc.next().charAt(0);//to take input of character datatype
String s= sc.next();//to take input of string datatype (only one word)
String h= sc.nextLine();//to take input of string datatype(more than one word)
System.out.println("PRINTING THE ABOVE TAKEN INPUT");
System.out.println(d);
System.out.println(a);
System.out.println(r);
System.out.println(i);
System.out.println(v);
System.out.println(s);
System.out.println(h);
}
}