JAVA CODES
DATATYPE:01
package java.first;
import java.util.Scanner;
public class First {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
byte a;
System.out.println("Enter byte value ");
a=sc.nextByte();
short b;
System.out.println("Enter short value ");
b=sc.nextShort();
int c;
System.out.println("Enter int value ");
c=sc.nextInt();
long d;
System.out.println("Enter long value ");
d=sc.nextLong();
float e;
System.out.println("Enter Float value ");
e=sc.nextFloat();
double f;
System.out.println("Enter DOUBLE value ");
f=sc.nextDouble();
boolean g;
System.out.println("Enter BOOLAEN value ");
g=sc.nextBoolean();
char h;
System.out.println("Enter character value ");
h=sc.next().charAt(0);
System.out.println("Enter byte value "+a);
System.out.println("Enter short value "+b);
System.out.println("Enter int value "+c);
System.out.println("Enter long value "+d);
System.out.println("Enter Float value "+e);
System.out.println("Enter DOUBLE value "+f);
System.out.println("Enter BOOLAEN value "+g);
System.out.println("Enter character value "+h);
}
}
No comments:
Post a Comment