Let's see how to use variables in JAVA in a simple tutorial.
Let's see an example of variable declarations in JAVA:
public class Main { /** * @param args */ public static void main(String[] args) { byte aByte; short aShort; int anInt; long aLong; float aFloat; double aDouble; char aChar; boolean aBoolean; aByte = 123; aShort = 12345; anInt = 1234567890; aLong = 1000000000000000000L; aFloat = 9.12345678912345678912345678945123F; aDouble = 0.3333333333333333333333333333333333333333334; aChar = 65; aBoolean = true; System.out.println("aByte = " + aByte); System.out.println("aShort = " + aShort); System.out.println("anInt = " + anInt); System.out.println("aLong = " + aLong); System.out.println("aFloat = " + aFloat); System.out.println("aDouble = " + aDouble); System.out.println("aChar = " + aChar); System.out.println("aBoolean = " + aBoolean); } }
Add new comment