Java Programming[4] - Numeric Datatype and Operations

Veröffentlicht am: 22 Oktober 2020
auf dem Kanal: Where is Elvin
598
26

In this video we have discussed the numeric data type in java, type casting, literals and numeric operators.

Here is the code for our first program in the discussion:

import java.util.Scanner;
public class NumericTypeInput
{
public static void main(String ec[])
{
byte varByte;
short varShort;
int varInt;
long varLong;
float varFloat;
double varDouble;

Scanner input = new Scanner(System.in);
System.out.print("Enter a byte value: ");
varByte = input.nextByte();

System.out.print("Enter a short value: ");
varShort = input.nextShort();

System.out.print("Enter an int value: ");
varInt = input.nextInt();

System.out.print("Enter a long value: ");
varLong = input.nextLong();

System.out.print("Enter a float value: ");
varFloat = input.nextFloat();

System.out.print("Enter a float value: ");
varDouble = input.nextDouble();

System.out.println("Byte = " + varByte
"\n Short = " + varShort + "\n Int = "
varInt + "\n Long = " + varLong
"\n Float = " + varFloat
"\n Double = "+varDouble);
}
}


Auf dieser Seite können Sie das Online-Video Java Programming[4] - Numeric Datatype and Operations mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Where is Elvin 22 Oktober 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 598 Mal angesehen und es wurde von 26 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!