package conversionwideing;
/**
*
* @author Sabit
*/
import java.util.Scanner;
public class ConversionWideing {
public static void main(String[] args) {
Scanner S = new Scanner(System.in);
byte b;
System.out.println("Enter a Value: ");
b = S.nextByte();
////convertino all
short st = b;
int i = st;
long l = i;
float f = l;
double d = f;
System.out.println("Byte: "+b);
System.out.println("Short: "+st);
System.out.println("Int: "+i);
System.out.println("Long: "+l);
System.out.println("Float: "+f);
System.out.println("Double: "+d);
}
}
Output
Enter a value:
123
Byte:123
Short:123
Int:123
Long:123
Float:123.0
Double:123.0
Add your comment